public override async void CanExecuteCommand(params IJavascriptObject[] e) { var parameter = _JavascriptToCSharpConverter.GetFirstArgumentOrNull(e); await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute(parameter)); UpdateCanExecuteValue(); }
public override async void CanExecuteCommand(params IJavascriptObject[] e) { var parameter = _JavascriptToCSharpConverter.GetFirstArgument <T>(e); if (!parameter.Success) { Logger.Error($"Impossible to call CanExecuteCommand on command<{typeof(T)}>, no matching argument found, received:{parameter.TentativeValue} of type:{parameter.TentativeValue?.GetType()} expectedType: {typeof(T)}"); return; } await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute(parameter.Value)); UpdateCanExecuteValue(); }
private async void ComputeCanExecute() { await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute); UpdateCanExecuteValue(); }
public Task RunOnUiContextAsync(Action act) { return(UiDispatcher.RunAsync(act)); }