//private void AddFieldHoverOrFocusStyles(HashSet<IRule> rules, ITheme theme, string pseudoSelector)
        //{
        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled) .ms-ChoiceField-field:{pseudoSelector} .ms-ChoiceFieldLabel").AppendCssStyles(
        //       $"color:{theme.Palette.NeutralDark}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled) .is-checked .ms-ChoiceField-field:{pseudoSelector}:before").AppendCssStyles(
        //        $"border-color:{theme.Palette.ThemeDark}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled):not(.is-checked) .ms-ChoiceField-field:{pseudoSelector}:before").AppendCssStyles(
        //        $"border-color:var(--semanticColors.InputBorderHovered}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled):not(.is-checked):not(.custom-content) .ms-ChoiceField-field:{pseudoSelector}:after").AppendCssStyles(
        //        "content:''",
        //        "transition-property:background-color",
        //        "left:5px",
        //        "top:5px",
        //        "width:10px",
        //        "height:10px",
        //        $"background-color:{theme.Palette.NeutralSecondary}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled) .is-checked .ms-ChoiceField-field:{pseudoSelector}").AppendCssStyles(
        //        $"border-color:{theme.Palette.ThemeDark}");
        //}

        //private void AddFieldWithCustomContentRules(HashSet<IRule> rules, ITheme theme, string pseudoSelector)
        //{
        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled).is-checked.custom-content .ms-ChoiceField-field:{pseudoSelector}").AppendCssStyles(
        //      $"border-color:{theme.Palette.ThemeDark}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled):not(.is-checked).custom-content .ms-ChoiceField-field:{pseudoSelector}").AppendCssStyles(
        //      $"border-color:var(--semanticColors.InputBorderHovered}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled) .is-checked.custom-content .ms-ChoiceField-field:{pseudoSelector}:before").AppendCssStyles(
        //        "opacity:1",
        //        $"border-color:{theme.Palette.ThemeDark}");

        //    rules.AddCssStringSelector($".ms-ChoiceField:not(.is-disabled):not(.is-checked).custom-content .ms-ChoiceField-field:{pseudoSelector}:before").AppendCssStyles(
        //        "opacity:1",
        //        $"border-color:var(--semanticColors.InputBorderHovered}");
        //}

        //private void AddCustomContentWrapperStyle(HashSet<IRule> rules, ITheme theme)
        //{
        //    rules.AddCssStringSelector(".custom-content .ms-ChoiceField-customContentWrapper").AppendCssStyles(
        //        "padding-bottom:2px",
        //        "transition-property:opacity",
        //        $"transition-duration:{_transitionDuration}",
        //        "transition-timing-function:ease");

        //    rules.AddCssStringSelector(".ms-ChoiceField-customContentWrapper .ms-Image").AppendCssStyles(
        //        "display:inline-block",
        //        "border-style:none");
        //}

        private async Task OnOptionClick(MouseEventArgs mouseEventArgs)
        {
            if (!IsDisabled)
            {
                await OnClick.InvokeAsync(new ChoiceGroupOptionClickedEventArgs { Item = Item, MouseEventArgs = mouseEventArgs });
            }
        }
示例#2
0
 private async Task HandleOnClick(MouseEventArgs args)
 {
     if (OnClick.HasDelegate)
     {
         await OnClick.InvokeAsync(args);
     }
 }
 protected void OnClickEvent(MouseEventArgs e)
 {
     if (OnClick.HasDelegate)
     {
         OnClick.InvokeAsync(e);
     }
 }
示例#4
0
        /// <summary>
        ///  OnClickHandler parameter.
        /// </summary>
        protected async void OnClickHandler(MouseEventArgs e)
        {
            if (Disabled)
            {
                return;
            }

            if (AllowSelection)
            {
                await this.ToggleSelectedAsync();
            }

            if (Href != null)
            {
                UriHelper.NavigateTo(Href);
            }
            else
            {
                await OnClick.InvokeAsync(e);

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
示例#5
0
 private async Task OnItemClickAsync(int index)
 {
     if (KeyboardInteractions && !AppliedDisabled)
     {
         await OnClick.InvokeAsync(index);
     }
 }
示例#6
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);
                }
            }
        }
 private void OnButtonClick()
 {
     if (!IsDisabled)
     {
         OnClick.InvokeAsync();
     }
 }
示例#8
0
 private async void DoOnClick(MouseEventArgs e)
 {
     if (OnClick.HasDelegate)
     {
         await OnClick.InvokeAsync(e);
     }
 }
示例#9
0
        protected async Task OnClickHandler(MouseEventArgs ev)
        {
            if (Link != null)
            {
                if (!string.IsNullOrEmpty(Target))
                {
                    try
                    {
                        await JsInvokeAsync <object>("open", Link, Target);
                    }
                    catch (TaskCanceledException ex)
                    {
                        Console.WriteLine(ex);
                    }
                }
                else
                {
                    UriHelper.NavigateTo(Link, ForceLoad);
                }
            }
            else
            {
                await OnClick.InvokeAsync(ev);

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
        protected async Task ContinueSeq()  // continue sequencing - tracking new notes
        {
            // first check for responses
            NoteHeader x = Model.AllNotes.Where(p => p.NoteOrdinal == currentHeader.NoteOrdinal &&
                                                p.ResponseOrdinal > currentHeader.ResponseOrdinal &&
                                                p.LastEdited > trackers[seqIndx].LastTime)
                           .OrderBy(p => p.ResponseOrdinal).FirstOrDefault();

            if (x != null) // found a response
            {
                currentHeader = x;
                await SetNote();

                return;
            }
            // else goto next base
            seqBaseIndx++;
            if (seqBaseIndx >= SeqBases.Count)  // finished with this file
            {
                await OnClick.InvokeAsync("SeqFileDone");

                return;
            }
            currentHeader = SeqBases[seqBaseIndx];
            await SetNote();
        }
示例#11
0
 private async Task ClickEvent()
 {
     if (OnClick.HasDelegate)
     {
         await OnClick.InvokeAsync();
     }
 }
示例#12
0
        /// <summary>
        ///  OnClickHandler parameter.
        /// </summary>
        protected async void OnClickHandler(MouseEventArgs e)
        {
            if (Disabled)
            {
                return;
            }

            if (AllowSelection)
            {
                await this.ToggleSelectedAsync();
            }

            if (Href != null)
            {
                if (!string.IsNullOrEmpty(Target))
                {
                    // Do nothing here as it is a target for an anchor tag
                }
                else
                {
                    UriHelper.NavigateTo(Href, ForceLoad);
                }
            }
            else
            {
                await OnClick.InvokeAsync(e);

                if (Command?.CanExecute(CommandParameter) ?? false)
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
示例#13
0
 private void HandleClick()
 {
     if (OnClick.HasDelegate)
     {
         OnClick.InvokeAsync(this);
     }
 }
 protected virtual async Task HandleOnClick(MouseEventArgs e)
 {
     if (IsEnabled)
     {
         await OnClick.InvokeAsync(e);
     }
 }
示例#15
0
        /// <summary>
        /// OnInitialized 方法
        /// </summary>
        protected override void OnInitialized()
        {
            base.OnInitialized();

            if (Size == Size.None)
            {
                Size = Size.ExtraSmall;
            }

            OnClickButton = EventCallback.Factory.Create <MouseEventArgs>(this, async e =>
            {
                if (IsAsync)
                {
                    ButtonIcon = LoadingIcon;
                    IsDisabled = true;
                }
                if (OnClickWithoutRender != null)
                {
                    await OnClickWithoutRender();
                }
                if (OnClickCallback != null)
                {
                    await OnClickCallback();
                }
                if (OnClick.HasDelegate)
                {
                    await OnClick.InvokeAsync(e);
                }
                if (IsAsync)
                {
                    ButtonIcon = Icon;
                    IsDisabled = false;
                }
            });
        }
示例#16
0
 private async void DoOnClick(MouseEventArgs e)
 {
     if (OnClick.HasDelegate && Type != ButtonType.Disabled)
     {
         await OnClick.InvokeAsync(e);
     }
 }
示例#17
0
        private async Task ToogleActive(MouseEventArgs e)
        {
            isActive = !isActive;
            await ActiveChanged.InvokeAsync(isActive);

            await OnClick.InvokeAsync(e);
        }
示例#18
0
 private void ClickEvent()
 {
     OnClick.InvokeAsync(this);
     if (!string.IsNullOrEmpty(NavigateTo))
     {
         NavigationManager.NavigateTo(NavigateTo);
     }
 }
示例#19
0
 protected async Task LoadAsync()
 {
     if (HasMore && !IsLoading)
     {
         _ = ElementInterop.BlurAsync(Button);
         await OnClick.InvokeAsync();
     }
 }
示例#20
0
        /// <summary>
        /// Handle the trigger click.
        /// </summary>
        /// <param name="args">MouseEventArgs</param>
        /// <returns></returns>
        public override async Task OnClickDiv(MouseEventArgs args)
        {
            if (!IsButton)
            {
                await OnTriggerClick();

                await OnClick.InvokeAsync(args);
            }
        }
示例#21
0
        public async Task OnLinkClickAsync(MouseEventArgs args, AnchorLink anchorLink)
        {
            await JsInvokeAsync("window.eval", $"window.location.hash='{anchorLink._hash}'");

            if (OnClick.HasDelegate)
            {
                await OnClick.InvokeAsync(new Tuple <MouseEventArgs, AnchorLink>(args, anchorLink));
            }
        }
示例#22
0
        private async Task OnTagClick()
        {
            if (!OnClick.HasDelegate)
            {
                return;
            }

            await OnClick.InvokeAsync(null);
        }
        protected override async Task HandleKeyDownAsync(KeyboardEventArgs args)
        {
            await base.HandleKeyDownAsync(args);

            if (Enter && args.Key == "Enter")
            {
                await OnClick.InvokeAsync(args);
            }
        }
示例#24
0
        protected async Task OnCloseHandler(MouseEventArgs ev)
        {
            await OnClick.InvokeAsync(ev);

            if (Command?.CanExecute(CommandParameter) ?? false)
            {
                Command.Execute(CommandParameter);
            }
            // Close code here? if user wants something to happen onclose click above?
        }
示例#25
0
        protected async Task OnClickHandler(MouseEventArgs ev)
        {
            await OnClick.InvokeAsync(ev);

            if (Command?.CanExecute(CommandParameter) ?? false)
            {
                Command.Execute(CommandParameter);
            }
            Activateable?.Activate(this, ev);
        }
示例#26
0
        private async Task HandleClick(MouseEventArgs e)
        {
            if (!IsEnabled)
            {
                return;
            }
            await Menu.Close();

            await OnClick.InvokeAsync();
        }
 private void HandleClick()
 {
     if (OnClick.HasDelegate)
     {
         OnClick.InvokeAsync(this);
     }
     if (ItemClickCallback.HasDelegate)
     {
         ItemClickCallback.InvokeAsync(this);
     }
 }
 protected void onClickEvent(UIMouseEventArgs e)
 {
     if (OnClick.HasDelegate)
     {
         OnClick.InvokeAsync(e);
     }
     if (!StayOpen && DropDown?.IsSubmenu == false && !HasSubMenu)
     {
         DropDown.Selected = null;
     }
 }
示例#29
0
 protected virtual async Task OnClickDiv(MouseEventArgs args)
 {
     if (!IsButton)
     {
         await OnTriggerClick();
     }
     else
     {
         await OnClick.InvokeAsync(args);
     }
 }
示例#30
0
        protected async override Task OnEditAsync()
        {
            await base.OnEditAsync();

            if (IsEditMode)
            {
                await OnClick.InvokeAsync();
            }

            await OnResetAsync();
        }