예제 #1
0
 public static Command CreateSync(
     this CommandFactoryInstance factory,
     Func <ValueTask> execute) =>
 throw new InvalidOperationException("Use Create instead.");
예제 #2
0
 public static Command CreateSync(
     this CommandFactoryInstance factory,
     Action execute,
     Func <bool> canExecute) =>
 new SyncDelegatedCommand(execute, canExecute);
예제 #3
0
 public static Command CreateSync <TParameter>(
     this CommandFactoryInstance factory,
     Action <TParameter> execute,
     Func <TParameter, bool> canExecute) =>
 new SyncDelegatedCommand <TParameter>(execute, canExecute);
예제 #4
0
 public static Command CreateSync <TParameter>(
     this CommandFactoryInstance factory,
     Func <TParameter, ValueTask> execute,
     Func <TParameter, bool> canExecute) =>
 throw new InvalidOperationException("Use Create instead.");
예제 #5
0
 public static Command Create(
     this CommandFactoryInstance factory,
     Func <ValueTask> executeAsync,
     Func <bool> canExecute) =>
 new DelegatedCommand(() => executeAsync().AsValueTaskUnit(), canExecute);
예제 #6
0
 public static Command Create <TParameter>(
     this CommandFactoryInstance factory,
     Func <TParameter, ValueTask> executeAsync,
     Func <TParameter, bool> canExecute) =>
 new DelegatedCommand <TParameter>(p => executeAsync(p).AsValueTaskUnit(), canExecute);
예제 #7
0
 public static Command Create <TParameter>(
     this CommandFactoryInstance factory,
     Func <TParameter, Task> executeAsync) =>
 new DelegatedCommand <TParameter>(parameter => executeAsync(parameter).AsValueTaskUnit());
예제 #8
0
 public static Command Create(
     this CommandFactoryInstance factory,
     Func <Task> executeAsync) =>
 new DelegatedCommand(() => executeAsync().AsValueTaskUnit());