Using system;
Using system. windows;
Using system. Windows. controls;
Using system. Windows. Controls. primitives;
Using system. Windows. input;
Using system. Windows. Media;
Namespace sayhello
{
Class togglethebutton: Window
{
[Stathread]
Public static void main ()
{
Application APP = new application ();
App. Run (New togglethebutton ());
}
Public togglethebutton ()
{
Title = "toggle the button ";
Togglebutton BTN = new togglebutton ();
BTN. content = "can_resize ";
BTN. horizontalalignment = horizontalalignment. Center;
BTN. verticalalignment = verticalignment. Center;
BTN. ischecked = (resizemode = resizemode. canresize );
BTN. Checked + = buttononchecked;
BTN. Unchecked + = buttononchecked;
Content = BTN;
}
Void buttononchecked (Object sender, routedeventargs ARGs)
{
Togglebutton BTN = new togglebutton ();
Resizemode = (bool) BTN. ischecked? Resizemode. canresize: resizemode. noresize;
}
}
}