public void ChangeSelectedTab(Tab tab) { if (_selectedTab != null) { _selectedTab.IsSelected = false; } _selectedTab = tab; if (this.OnTabChanged != null) this.OnTabChanged(_selectedTab, EventArgs.Empty); }
public void AddTab(string name, bool isSelected = false) { var newTab = new Tab() { Name = name, IsSelected = isSelected }; _data.Add(newTab); if (isSelected) _selectedTab = newTab; }
public void ChangeSelectedTab(Tab tab) { if (_selectedTab != null) { _selectedTab.IsSelected = false; } _selectedTab = tab; Invalidate(); OnTabChanged?.Invoke(_selectedTab, EventArgs.Empty); TabChangedCommand?.Execute(tab); }