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

            UpdateCanExecuteValue();
        }
Example #2
0
        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));
        }
Example #4
0
        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();
        }
Example #5
0
        public override void Execute(IJavascriptObject[] e)
        {
            var parameter = JavascriptToGlueMapper.GetFirstArgumentOrNull(e);

            UiDispatcher.Dispatch(() => _Command.Execute(parameter));
        }