Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 3
0
 void OnActiveTabChanged(EventArgs e)
 {
     ActiveTabChanged?.Invoke(this, e);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Invokes active tab changed event
 /// </summary>
 /// <param name="tab">New active tab</param>
 protected virtual void OnActiveTabChanged(Tab tab)
 {
     ActiveTabChanged?.Invoke(this, tab);
 }