コード例 #1
0
        /// <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);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 protected virtual void OnIsSelectedChanged(bool oldValue, bool newValue)
 {
     if (newValue)
     {
         TabSelected?.Invoke(this, new EventArgs());
     }
     else
     {
         TabDeselected?.Invoke(this, new EventArgs());
     }
     NotifyPropertyChanged(nameof(IsSelected));
 }
コード例 #4
0
        /// <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();
        }
コード例 #5
0
ファイル: CLEMView.cs プロジェクト: BrianCollinss/ApsimNG
 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);
     }
 }
コード例 #6
0
ファイル: OWTabStrip.cs プロジェクト: Cruyjun/OfficeWorks
 /// <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);
 }
コード例 #7
0
ファイル: RadegastTabEvents.cs プロジェクト: TsengSR/Radegast
 protected virtual void OnTabSelected(EventArgs e)
 {
     TabSelected?.Invoke(this, e);
 }
コード例 #8
0
        //private void Grid_PreviewKeyDown(object sender, KeyEventArgs e)
        //{
        //    TabSelected?.Invoke(sender, e);
        //}

        private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            TabSelected?.Invoke(sender, e);
        }
コード例 #9
0
 private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
 {
     TabSelected?.Invoke(tabControl.SelectedIndex);
 }