added samples
[windows-sources.git] / sdk / samples / CrossTechnologySamples / VistaBridge / vistabridgecontrols / commandlink.xaml.cs
blobb621d4a8ad3dbeb73be4b635331bd49b5ca49a6d
1 using System;
2 using System.Windows;
3 using System.Windows.Controls;
4 using System.Windows.Data;
5 using System.Windows.Documents;
6 using System.Windows.Media;
7 using System.Windows.Media.Imaging;
8 using System.Windows.Navigation;
9 using System.Windows.Shapes;
10 using System.Windows.Input;
11 using System.ComponentModel;
13 namespace AERO
15 /// <summary>
16 /// Interaction logic for CommandLink.xaml
17 /// </summary>
19 public partial class CommandLink : UserControl, INotifyPropertyChanged
21 public CommandLink()
23 this.DataContext = this;
25 InitializeComponent();
27 this.button.Click += new RoutedEventHandler(button_Click);
31 void button_Click(object sender, RoutedEventArgs e)
33 e.Source = this;
35 if(Click != null)
36 Click(sender, e);
39 RoutedUICommand command;
41 public RoutedUICommand Command
43 get { return command; }
44 set { command = value; }
47 public event RoutedEventHandler Click;
49 private string link;
51 public string Link
53 get { return link; }
54 set
56 link = value;
58 if (PropertyChanged != null)
60 PropertyChanged(this, new PropertyChangedEventArgs("Link"));
64 private string note;
66 public string Note
68 get { return note; }
69 set
71 note = value;
72 if (PropertyChanged != null)
74 PropertyChanged(this, new PropertyChangedEventArgs("Note"));
78 private ImageSource icon;
80 public ImageSource Icon
82 get { return icon; }
83 set
85 icon = value;
86 if (PropertyChanged != null)
88 PropertyChanged(this, new PropertyChangedEventArgs("Icon"));
93 public bool? IsCheck
95 get
97 return button.IsChecked;
99 set { button.IsChecked = value; }
103 #region INotifyPropertyChanged Members
105 public event PropertyChangedEventHandler PropertyChanged;
107 #endregion