Exemplo n.º 1
0
        public override async void CanExecuteCommand(params IJavascriptObject[] e)
        {
            var parameter = _JavascriptToCSharpConverter.GetFirstArgumentOrNull(e);
            await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute(parameter));

            UpdateCanExecuteValue();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        private async void ComputeCanExecute()
        {
            await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute);

            UpdateCanExecuteValue();
        }
Exemplo n.º 4
0
 public Task RunOnUiContextAsync(Action act)
 {
     return(UiDispatcher.RunAsync(act));
 }