Beispiel #1
0
        protected async Task OnClickHandler(MouseEventArgs ev)
        {
            if (Disabled)
            {
                return;
            }
            MudMenu.CloseMenu();

            if (Link != null)
            {
                if (string.IsNullOrWhiteSpace(Target))
                {
                    UriHelper.NavigateTo(Link, ForceLoad);
                }
                else
                {
                    await JsApiService.Open(Link, Target);
                }
            }
            else
            {
                await OnClick.InvokeAsync(ev);

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
Beispiel #2
0
        protected async Task OnClickHandler(MouseEventArgs ev)
        {
            MudMenu.CloseMenu();

            if (Link != null)
            {
                if (string.IsNullOrWhiteSpace(Target))
                {
                    UriHelper.NavigateTo(Link, ForceLoad);
                }
                else
                {
                    await JsRuntime.InvokeAsync <object>("open", Link, Target);
                }
            }
            else
            {
                await OnClick.InvokeAsync(ev);

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }