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
| private IDisableableCommand _addCommand; | |
| public IDisableableCommand AddCommand | |
| { | |
| get | |
| { | |
| if (_addCommand == null) | |
| _addCommand = new DisableableCommandAsync( | |
| AddCommandHandler, | |
| obj => true, | |
| new List<IDisableableCommand>() { RemoveCommand, UpdateCommand }); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using System.Windows.Input; | |
| namespace AsyncDisablingScopeSample | |
| { | |
| public class DisableableCommandAsync : IDisableableCommand | |
| { |
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
| /// <summary> | |
| /// DisableableCommandAsync Constructor | |
| /// </summary> | |
| /// <param name="asyncExecute">Executing Delegate</param> | |
| /// <param name="canExecute">Predicate for enabling/disabling</param> | |
| /// <param name="disablables">List of IDisaeable Items to be disabled while executing</param> | |
| /// <param name="disableWhileInProgress">Disable the Command itself while executing</param> | |
| public DisableableCommandAsync(Func<object,Task> asyncExecute, | |
| Predicate<object> canExecute, | |
| IEnumerable<IDisableableCommand> disablables = null, |
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
| using System; | |
| using System.Threading.Tasks; | |
| using System.Windows.Input; | |
| namespace AsyncDisablingScopeSample | |
| { | |
| public class RelayCommandAsync : ICommand | |
| { | |
| #region Fields |
NewerOlder