protected override MayBe <TArg> GetArgumentValueOnJsContext(IJavascriptObject[] e) { var argument = JavascriptToGlueMapper.GetFirstArgument <TArg>(e); if (!argument.Success) { Logger.Error($"Impossible to call Execute on command<{typeof(TArg)}>, no matching argument found, received:{argument.TentativeValue} of type:{argument.TentativeValue?.GetType()} expectedType: {typeof(TArg)}"); } return(argument); }
void IExecutableGlue.Execute(IJavascriptObject[] e) { var parameter = JavascriptToGlueMapper.GetFirstArgument <T>(e); if (!parameter.Success) { Logger.Error($"Impossible to call simple command, no matching argument found, received:{parameter.TentativeValue} of type:{parameter.TentativeValue?.GetType()} expectedType: {typeof(T)}"); return; } UiDispatcher.Dispatch(() => _JsSimpleCommand.Execute(parameter.Value)); }
public override async void CanExecuteCommand(params IJavascriptObject[] e) { var parameter = JavascriptToGlueMapper.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(); }