コード例 #1
0
 /// <summary>
 /// Creates an instance with its own implementation of <see cref="ICommand.CanExecuteChanged"/>.
 /// </summary>
 protected AsyncCommandBase()
 {
     _canExecuteChanged = new WeakCanExecuteChanged(this);
 }
コード例 #2
0
 /// <summary>
 /// Creates a new explicit implementation of <c>ICommand.CanExecuteChanged</c>.
 /// </summary>
 /// <param name="sender">The sender of the <c>ICommand.CanExecuteChanged</c> event.</param>
 public ExplicitCanExecute(object sender)
 {
     _canExecuteChanged = new WeakCanExecuteChanged(sender);
     _threadAffinity    = ThreadAffinity.BindToCurrentThread();
 }
コード例 #3
0
ファイル: CancelCommand.cs プロジェクト: roubachof/Mvvm.Async
 /// <summary>
 /// Creates a new cancel command.
 /// </summary>
 public CancelCommand()
 {
     _cts = new CancellationTokenSource();
     _cts.Cancel();
     _canExecuteChanged = new WeakCanExecuteChanged(this);
 }