diff --git a/BindButtonCommand.png b/BindButtonCommand.png new file mode 100644 index 0000000..709ca0c Binary files /dev/null and b/BindButtonCommand.png differ diff --git a/README.md b/README.md index a709311..bbbc700 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ -# how-to-bind-button-command-to-view-model-in-wpf-and-uwp-treegrid-in-mvvm +# How to Bind Button Command to ViewModel in WPF / UWP TreeGrid in MVVM? -This example illustrates to bind the button command to ViewModel in treegrid. \ No newline at end of file +This example illustrates to bind the Button command to ViewModel in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) and [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid) (SfTreeGrid). + +You can load a button for the columns in TreeGrid using [TreeGridTemplateColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridTemplateColumn.html). When loading the buttons, you can bind a command in ViewModel using ElementName binding. + +In the following example, ViewModel command receives the underlying data object as command parameter, since the DataContext is bound as command parameter. + +### XAML: +``` xml + + + +