public DockNotebook() { // Emit an event when the current tab is changed. SwitchPage += (o, args) => { var widget = args.Page; IDockNotebookItem?item = items.Where(i => i.Widget == widget).FirstOrDefault(); ActiveTabChanged?.Invoke(this, new TabEventArgs(item)); }; Scrollable = true; }
public void ActivateTab(string identifier) { if (activeTabIdentifier == identifier) { return; } foreach (var tab in tabViews) { if (tab.Key == identifier) { tab.Value.Selected = true; activeTabIdentifier = identifier; ActiveTabChanged?.Invoke(identifier); } else { tab.Value.Selected = false; } } }
void OnActiveTabChanged(EventArgs e) { ActiveTabChanged?.Invoke(this, e); }
/// <summary> /// Invokes active tab changed event /// </summary> /// <param name="tab">New active tab</param> protected virtual void OnActiveTabChanged(Tab tab) { ActiveTabChanged?.Invoke(this, tab); }