internal async Task OnInternalSelectAsync(SelectResultModel <TValue> item)
        {
            var args = new BChangeEventArgs <SelectResultModel <TValue> >();

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

                if (args.DisallowChange)
                {
                    return;
                }
            }

            await dropDownOption.Instance.CloseDropDownAsync(dropDownOption);

            SelectedOption = item;
            SetFieldValue(item.Key, true);
            Value = item.Key;
            if (dict != null)
            {
                dict.TryGetValue(Value, out var label);
                Label = label;
            }
            if (OnChange.HasDelegate)
            {
                await OnChange.InvokeAsync(args);
            }
            Console.WriteLine(Label);
            EnableClearButton = false;
            StateHasChanged();
        }
示例#2
0
        internal async Task OnInternalSelectAsync(BSelectOptionBase <TValue> item)
        {
            var args = new BChangeEventArgs <BSelectOptionBase <TValue> >();

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

                if (args.DisallowChange)
                {
                    return;
                }
            }

            await dropDownOption.Instance.CloseDropDownAsync(dropDownOption);

            SelectedOption = item;
            SetFieldValue(item.Value, true);
            Value = item.Value;
            if (dict != null)
            {
                dict.TryGetValue(Value, out var label);
                Label = label;
            }
            if (OnChange.HasDelegate)
            {
                await OnChange.InvokeAsync(args);
            }
            IsClearButtonClick = false;
            StateHasChanged();
        }