示例#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());