diff --git a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml
index b82e6c2a..e6c2d22b 100644
--- a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml
+++ b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml
@@ -1,6 +1,7 @@
-
+
-
+
+
+
+
+
+
+
diff --git a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs
index e274dfd6..2a5303a6 100644
--- a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs
+++ b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs
@@ -11,6 +11,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using System.ComponentModel;
+using System.Collections.ObjectModel;
namespace Samples.Modules.Button.Views
{
@@ -22,6 +24,102 @@ namespace Samples.Modules.Button.Views
public HomeView()
{
InitializeComponent();
+ DataContext = new MyViewModel();
+ }
+ }
+
+ public class Item
+ {
+ public bool IsChecked { get; set; }
+ public string Name { get; set; }
+
+ public Item()
+ {
+
+ }
+ }
+ public class MyViewModel : INotifyPropertyChanged
+ {
+ public ICommand MyCommand { get; private set; }
+
+ private int _clickCount;
+ public int ClickCount
+ {
+ get { return _clickCount; }
+ set
+ {
+ _clickCount = value;
+ OnPropertyChanged("ClickCount");
+ }
+ }
+
+ private ObservableCollection- _items;
+ public ObservableCollection
- Items
+ {
+ get { return _items; }
+ set
+ {
+ _items = value;
+ OnPropertyChanged("Items");
+ }
+ }
+
+
+ public MyViewModel()
+ {
+ MyCommand = new CustomCommand(Execute, CanExecute);
+
+ Items = new ObservableCollection
- ();
+ for (int i = 0; i < 10; i++)
+ {
+ Items.Add(new Item() { IsChecked = i % 2 == 0, Name = String.Format("Item {0}", i) });
+ }
+ }
+
+ private void Execute(object param)
+ {
+ ClickCount++;
+ //MessageBox.Show(String.Format("Executed {0}", param));
+ }
+
+ private bool CanExecute(object param)
+ {
+ return Convert.ToInt32(param) != 5;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged(string propertyName)
+ {
+ if (PropertyChanged != null)
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ public class CustomCommand : ICommand
+ {
+ Action