I have a view model which looks like:
public sealed class MyViewModel: INotifyPropertyChanged
{
public bool ShowSuccess
{
get { return _success; }
set
{
_success = value;
PropertyChanged?.Invoke( ... );
}
}
public ICommand TestCommand
{
get
{
_test = _test ?? new MyTestCommand();
return _test;
}
}
}
and the command
public sealed class MyTestCommand : ICommand
{
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
// do stuff
}
}
and in xaml
<Button Command="{Binding TestCommand}" Content="Test" />
I want to update ShowSuccess
property after executing Execute
from MyTestCommand
.
How to achieve that ?
Thanks
PS: I'm still newbie in WPF, just learned MVVM and custom command