void ChoosePanelUserControlViewChanged(ConfiguratorViewsEnum newView) { nestingControlsPanel.Controls.Clear(); nestingControlsPanel.Controls.Add(_views[newView]); nestingControlsPanel.Controls[0].Dock = DockStyle.Fill; nestingControlsPanel.AutoScrollMinSize = new System.Drawing.Size(_views[newView].MinimumSize.Width, _views[newView].MinimumSize.Height); optionsHeader.Title = choosePanelUserControl.SelectedCategory; }
void ChangeView(object sender, ConfiguratorViewsEnum newView) { if (_selectedButton != null) { _selectedButton.BackColor = _normalButtonColor; } var newCurrentButton = ((Button)sender); newCurrentButton.BackColor = _selectedButtonColor; _selectedButton = newCurrentButton; if (ViewChanged != null) { ViewChanged.Invoke(newView); } }