Пример #1
0
 public void RemoveOption(AutoCompleteOption option)
 {
     if (_options?.Contains(option) == true)
     {
         _options?.Remove(option);
     }
 }
Пример #2
0
 //设置高亮的对象
 public void SetActiveItem(AutoCompleteOption item)
 {
     this.ActiveValue = item?.Value;
     if (OnActiveChange.HasDelegate)
     {
         OnActiveChange.InvokeAsync(item);
     }
     StateHasChanged();
 }
Пример #3
0
        public async Task SetSelectedItem(AutoCompleteOption item)
        {
            if (item != null)
            {
                this.SelectedValue = item?.Value;
                this.SelectedItem  = item;
                _inputComponent?.SetValue(this.SelectedItem.Label);

                if (OnSelectionChange.HasDelegate)
                {
                    await OnSelectionChange.InvokeAsync(this.SelectedItem);
                }
            }
            this.ClosePanel();
        }
Пример #4
0
 public void AddOption(AutoCompleteOption option)
 {
     _options.Add(option);
 }
Пример #5
0
 public OptionSelectionChange(AutoCompleteOption source, bool isUserInput = false)
 {
     Source      = source;
     IsUserInput = isUserInput;
 }