I need
I changed code in "Binding column from view model" (SDK samples browser).
MyDataContext.cs:
When Button clicked nothing happend.
How to get Clicked Event?
I changed code in "Binding column from view model" (SDK samples browser).
MyDataContext.cs:
public ObservableCollection<
GridViewColumn
> Columns<
br
> {<
br
> get<
br
> {<
br
> if (columns == null)<
br
> {<
br
> columns = new ObservableCollection<
GridViewColumn
>();<
br
> columns.Add(new GridViewDataColumn() { DataMemberBinding = new System.Windows.Data.Binding("ID") });<
br
><
br
><
br
> FrameworkElementFactory fe = new FrameworkElementFactory(typeof(System.Windows.Controls.Button));<
br
> fe.AddHandler(System.Windows.Controls.Button.ClickEvent, new RoutedEventHandler(OnClick));<
br
> fe.SetValue(System.Windows.Controls.Button.ContentProperty, "Button");<
br
> DataTemplate dt2 = new DataTemplate();<
br
> dt2.VisualTree = fe;<
br
> dt2.Seal();<
br
><
br
> GridViewDataColumn col = new GridViewDataColumn() { DataMemberBinding = new System.Windows.Data.Binding("Name") };<
br
> col.CellTemplate = dt2;<
br
><
br
> columns.Add(col);<
br
> }<
br
> return columns;<
br
> }<
br
> }<
br
><
br
> private void OnClick(object sender, RoutedEventArgs e)<
br
> {<
br
> MessageBox.Show("The button was clicled");<
br
> }
How to get Clicked Event?