using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
namespace WpfApplication1
{
public class BindTheButton : Window
{
[STAThread]
public static void Main()
{
Application app = new Application();
app.Run(new BindTheButton());
}
public BindTheButton()
{
Title = "BindTheButton";
ToggleButton bt = new ToggleButton();
bt.Content = "make _t";
bt.HorizontalAlignment = HorizontalAlignment.Center;
bt.VerticalAlignment = VerticalAlignment.Center;
bt.SetBinding(ToggleButton.IsCheckedProperty, "tommost");
bt.DataContext = this;
Content = bt;
ToolTip tip = new ToolTip();
tip.Content = "toggle the button on to make" +
"the window topmost on the desktop";
bt.ToolTip = tip;
}
}
}