public static async Task TryExecuteAsync(this IViewModelCommand command, object arg) { if (command != null && command.CanExecute(arg)) { await command.ExecuteAsync(arg); } }
public static async Task TryExecuteAsync(this IViewModelCommand command) { if (command != null && command.CanExecute()) { await command.ExecuteAsync(); } }