private void ActivatePane(AccordionPane tabPane)
        {
            if (!tabPane.Disabled && _panes.Contains(tabPane))
            {
                if (_activePane != null)
                {
                    _activePane.IsActive = false;
                }
                tabPane.IsActive = true;
                _activePane      = tabPane;
                if (_activeKey != _activePane.Key)
                {
                    if (!string.IsNullOrEmpty(_activeKey))
                    {
                        if (ActiveKeyChanged.HasDelegate)
                        {
                            ActiveKeyChanged.InvokeAsync(_activePane.Key);
                        }

                        if (OnChange.HasDelegate)
                        {
                            OnChange.InvokeAsync(_activePane.Key);
                        }
                    }
                    _activeKey = _activePane.Key;
                }
                StateHasChanged();
            }
        }
Exemple #2
0
        private void OnActiveKeyChanged(object?sender, string?key)
        {
            ActiveKey = key;
            ActiveKeyChanged.InvokeAsync(key);

            StateHasChanged();
        }