How to use the CanExecute Method from ICommand on WPF
First to say i am at the very beginning of WPF and the MVVM Pattern. While trying some custom Commands i was wondering how to use the CanExecute Methode from the ICommand interface. In my example i have a SaveCommand which i only what to be enable when the object is saveable. The XAML Code of my Savebutton looks like this: <Button Content="Save" Command="{Binding SaveCommand, Mode=TwoWay}" /> This is the code of my save class: class Save : ICommand { public MainWindowViewModel viewModel { get; set; } public Save(MainWindowViewModel viewModel) { this.viewModel = viewModel; } public bool