/// <summary> /// Called when selected tab index is changed. /// </summary> private void SelectedTabIndexChanged() { TabSwitcher.SwitchTo(SelectedTabIndex); // toggle header if (TabHeaderGroup.LayoutChildren.Count > SelectedTabIndex) { if (SelectedTabIndex < 0) { foreach (TabHeader tabHeader in TabHeaderGroup.LayoutChildren) { tabHeader.ToggleValue = false; } } else { (TabHeaderGroup.LayoutChildren[SelectedTabIndex] as TabHeader).ToggleValue = true; var tab = TabSwitcher.ActiveView as Tab; TabSelectionActionData data = new TabSelectionActionData { IsSelected = true, Tab = tab, Item = tab.Item }; TabSelected?.Invoke(this, data); } } }
public void HandleTabSelected(IDMigrationMode newMode) { if (currentTab != null) { currentTab.MoveToOffset(new Vector2(0, -10), 500, Easing.OutQuint); currentTab.Selected = false; } (currentTab = this[newMode]).MoveToOffset(new Vector2(0, 10), 500, Easing.InQuint); TabSelected?.Invoke(newMode); }
protected virtual void OnIsSelectedChanged(bool oldValue, bool newValue) { if (newValue) { TabSelected?.Invoke(this, new EventArgs()); } else { TabDeselected?.Invoke(this, new EventArgs()); } NotifyPropertyChanged(nameof(IsSelected)); }
/// <summary> /// Handler for tab selection. /// </summary> /// <param name="control">Event source (TabButton).</param> internal virtual void OnTabPressed(Control control) { TabButton button = control as TabButton; if (null == button) { return; } Control page = button.Page; if (null == page) { return; } if (m_CurrentButton == button) { return; } if (null != m_CurrentButton) { Control page2 = m_CurrentButton.Page; if (page2 != null) { page2.IsHidden = true; } m_CurrentButton.Redraw(); m_CurrentButton = null; } m_CurrentButton = button; if (TabSelected != null) { TabSelected.Invoke(m_CurrentButton); } page.IsHidden = false; m_TabStrip.Invalidate(); Invalidate(); }
private void NotebookSwitchPage(object o, SwitchPageArgs args) { try { if (setupComplete && nbook.CurrentPage >= 0) { string selectedLabel = nbook.GetTabLabelText(nbook.GetNthPage(nbook.CurrentPage)); TabChangedEventArgs tabEArgs = new TabChangedEventArgs(selectedLabel); if (TabSelected != null) { TabSelected.Invoke(this, tabEArgs); } } } catch (Exception err) { ShowError(err); } }
/// <summary> /// Event Handler para a acção Send /// </summary> /// <remarks> /// Permite activar os eventos OnSetComplete, OnTransfer ou OnRequestForComments /// consoante a opção seleccionada /// </remarks> protected void TabClick(object sender, EventArgs e) { TabSelected.Invoke(this, e); }
protected virtual void OnTabSelected(EventArgs e) { TabSelected?.Invoke(this, e); }
//private void Grid_PreviewKeyDown(object sender, KeyEventArgs e) //{ // TabSelected?.Invoke(sender, e); //} private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e) { TabSelected?.Invoke(sender, e); }
private void tabControl_SelectedIndexChanged(object sender, EventArgs e) { TabSelected?.Invoke(tabControl.SelectedIndex); }