Created
May 31, 2017 09:57
-
-
Save atzimler/15d28af52caf3570142d894a6ea455f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestCommand : ICommand | |
{ | |
private bool _whatShouldWeReturnForCanExecute; | |
public bool WhatShouldWeReturnForCanExecute | |
{ | |
get => _whatShouldWeReturnForCanExecute; | |
set | |
{ | |
if (_whatShouldWeReturnForCanExecute == value) | |
{ | |
return; | |
} | |
_whatShouldWeReturnForCanExecute = value; | |
CanExecuteChanged?.Invoke(this, EventArgs.Empty); | |
} | |
} | |
public bool CanExecute(object parameter) | |
{ | |
return _whatShouldWeReturnForCanExecute; | |
} | |
public void Execute(object parameter) | |
{ | |
MessageBox.Show("TestCommand executed"); | |
} | |
public event EventHandler CanExecuteChanged; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment