Пример #1
0
        public override async void CanExecuteCommand(params IJavascriptObject[] e)
        {
            var parameter = _JavascriptToCSharpConverter.GetFirstArgumentOrNull(e);
            await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute(parameter));

            UpdateCanExecuteValue();
        }
Пример #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();
        }
Пример #3
0
        private async void ComputeCanExecute()
        {
            await UiDispatcher.RunAsync(() => _CanExecute = _Command.CanExecute);

            UpdateCanExecuteValue();
        }
Пример #4
0
 public Task RunOnUiContextAsync(Action act)
 {
     return(UiDispatcher.RunAsync(act));
 }