Beispiel #1
0
        internal async Task OnInternalSelectAsync(BSimpleOptionBase <TValue> item)
        {
            var args = new BChangeEventArgs <BSimpleOptionBase <TValue> >();

            args.NewValue = item;
            args.OldValue = SelectedOption;
            if (OnSelecting.HasDelegate)
            {
                await OnSelecting.InvokeAsync(args);

                if (args.DisallowChange)
                {
                    return;
                }
            }

            await DropDownOption.Instance.CloseDropDownAsync(DropDownOption);

            SelectedOption = item;
            SetFieldValue(item.Value);
            if (OnSelect.HasDelegate)
            {
                await OnSelect.InvokeAsync(args);
            }
            IsClearButtonClick = false;
            StateHasChanged();
        }
Beispiel #2
0
 public void HandleSelect(string value)
 {
     if (OnSelect.HasDelegate)
     {
         OnSelect.InvokeAsync(value);
     }
 }
Beispiel #3
0
        protected async Task OnSelectValue(DateTime date)
        {
            Value = date;

            await OnSelect.InvokeAsync(date);

            await OnChange.InvokeAsync(date);

            StateHasChanged();
        }
Beispiel #4
0
        public async Task OnRowSelected(RowSelectEventArgs <TModel> args)
        {
            try
            {
                CurrentModel = DataSource.SingleOrDefault(f => f.Equals(args.Data));
                await OnSelect.InvokeAsync(CurrentModel);

                IsShouldRender = false;
            }
            catch (Exception ex)
            {
                Toast.ShowWarning($"Erro ao carregar dados da entidade {typeof(TModel)} <br> Erro {ex.Message}");
            }
        }
 public async Task Select()
 {
     var item = Suggestions.Find(x => x.IsHighlighted).Item;
     await OnSelect.InvokeAsync(item);
 }