Exemplo n.º 1
0
        protected async Task OnClickHandler(MouseEventArgs ev)
        {
            Toggled = !Toggled;
            await ToggledChanged.InvokeAsync(Toggled);

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

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
 protected async Task SetToggledAsync(bool toggled)
 {
     if (Toggled != toggled)
     {
         Toggled = toggled;
         await ToggledChanged.InvokeAsync(Toggled);
     }
 }
 protected internal async Task SetToggledAsync(bool toggled)
 {
     if (Disabled)
     {
         return;
     }
     if (Toggled != toggled)
     {
         Toggled = toggled;
         await ToggledChanged.InvokeAsync(Toggled);
     }
 }
 public async Task Toggle()
 {
     _toggled = !_toggled;
     await ToggledChanged.InvokeAsync(_toggled);
 }