// Updates selected content
        private void UpdateSelectedContent()
        {
            if (base.SelectedIndex < 0)
            {
                this.SelectedContent = null;
            }
            else
            {
                BackstageTabItem selectedTabItem = this.GetSelectedTabItem();
                if (selectedTabItem != null)
                {
                    this.SelectedContent = selectedTabItem.Content;
                    if (((selectedTabItem.ContentTemplate != null) || (selectedTabItem.ContentTemplateSelector != null)) || (selectedTabItem.ContentStringFormat != null))
                    {
                        this.SelectedContentTemplate         = selectedTabItem.ContentTemplate;
                        this.SelectedContentTemplateSelector = selectedTabItem.ContentTemplateSelector;
                        this.SelectedContentStringFormat     = selectedTabItem.ContentStringFormat;
                    }
                    else
                    {
                        this.SelectedContentTemplate         = this.ContentTemplate;
                        this.SelectedContentTemplateSelector = this.ContentTemplateSelector;
                        this.SelectedContentStringFormat     = this.ContentStringFormat;
                    }

                    UpdateLayout();
                }
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ribbon = ((Fluent.Ribbon)(target));
                return;

            case 2:
                this.backStageTaItemAutoFilter = ((Fluent.BackstageTabItem)(target));
                return;

            case 3:
                this.backStageTaItemDashboard = ((Fluent.BackstageTabItem)(target));
                return;

            case 4:
                this.backStageTaItemCopyPaste = ((Fluent.BackstageTabItem)(target));
                return;

            case 5:
                this.backStageTaItemOther = ((Fluent.BackstageTabItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
 // Finds next tab item
 private BackstageTabItem FindNextTabItem(int startIndex, int direction)
 {
     if (direction != 0)
     {
         int index = startIndex;
         for (int i = 0; i < base.Items.Count; i++)
         {
             index += direction;
             if (index >= base.Items.Count)
             {
                 index = 0;
             }
             else if (index < 0)
             {
                 index = base.Items.Count - 1;
             }
             BackstageTabItem item2 = base.ItemContainerGenerator.ContainerFromIndex(index) as BackstageTabItem;
             if (((item2 != null) && item2.IsEnabled) && (item2.Visibility == Visibility.Visible))
             {
                 return(item2);
             }
         }
     }
     return(null);
 }
Example #4
0
 // Updates selected content
 private void UpdateSelectedContent()
 {
     if (base.SelectedIndex < 0)
     {
         this.SelectedContent = null;
     }
     else
     {
         BackstageTabItem selectedTabItem = this.GetSelectedTabItem();
         if (selectedTabItem != null)
         {
             this.SelectedContent = selectedTabItem.Content;
             UpdateLayout();
         }
     }
 }
        // Gets selected ribbon tab item
        BackstageTabItem GetSelectedTabItem()
        {
            object selectedItem = base.SelectedItem;

            if (selectedItem == null)
            {
                return(null);
            }
            BackstageTabItem item = selectedItem as BackstageTabItem;

            if (item == null)
            {
                item = FindNextTabItem(base.SelectedIndex, 1);
                base.SelectedItem = item;
            }
            return(item);
        }
 /// <summary>
 /// Updates the current selection when an item in the System.Windows.Controls.Primitives.Selector has changed
 /// </summary>
 /// <param name="e">The event data.</param>
 protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
 {
     base.OnItemsChanged(e);
     if ((e.Action == NotifyCollectionChangedAction.Remove) && (base.SelectedIndex == -1))
     {
         int startIndex = e.OldStartingIndex + 1;
         if (startIndex > base.Items.Count)
         {
             startIndex = 0;
         }
         BackstageTabItem item = FindNextTabItem(startIndex, -1);
         if (item != null)
         {
             item.IsSelected = true;
         }
     }
 }
Example #7
0
        // Handles IsSelected changed
        private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            BackstageTabItem container = (BackstageTabItem)d;
            bool             newValue  = (bool)e.NewValue;

            if (newValue)
            {
                BackstageTabControl backstage = container.Parent as BackstageTabControl;
                if ((backstage != null) && (backstage.SelectedItem != container))
                {
                    if (backstage.SelectedItem is BackstageTabItem)
                    {
                        (backstage.SelectedItem as BackstageTabItem).IsSelected = false;
                    }
                    backstage.SelectedItem = container;
                }
                container.OnSelected(new RoutedEventArgs(Selector.SelectedEvent, container));
            }
            else
            {
                container.OnUnselected(new RoutedEventArgs(Selector.UnselectedEvent, container));
            }
        }
Example #8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Ribbon_control = ((Fluent.Ribbon)(target));

            #line 17 "..\..\..\MainWindow.xaml"
                this.Ribbon_control.IsMinimizedChanged += new System.Windows.DependencyPropertyChangedEventHandler(this.Ribbon_control_IsMinimizedChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.backstage = ((Fluent.Backstage)(target));
                return;

            case 3:
                this.bsi_help = ((Fluent.BackstageTabItem)(target));
                return;

            case 4:
                this.grid_help = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.bsi_settings = ((Fluent.BackstageTabItem)(target));
                return;

            case 6:
                this.grid_settings = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.bsi_close = ((Fluent.BackstageTabItem)(target));

            #line 34 "..\..\..\MainWindow.xaml"
                this.bsi_close.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.bsi_close_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 8:
                this.bt_search = ((Fluent.Button)(target));

            #line 47 "..\..\..\MainWindow.xaml"
                this.bt_search.Click += new System.Windows.RoutedEventHandler(this.bt_geraetSuchen);

            #line default
            #line hidden
                return;

            case 9:
                this.bt_geraetEdit = ((Fluent.Button)(target));

            #line 50 "..\..\..\MainWindow.xaml"
                this.bt_geraetEdit.Click += new System.Windows.RoutedEventHandler(this.bt_geraetBearbeiten);

            #line default
            #line hidden
                return;

            case 10:
                this.bt_abfrage = ((Fluent.Button)(target));

            #line 53 "..\..\..\MainWindow.xaml"
                this.bt_abfrage.Click += new System.Windows.RoutedEventHandler(this.bt_abfrageStarten);

            #line default
            #line hidden
                return;

            case 11:
                this.tbl_info = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 12:
                this.logo = ((System.Windows.Controls.Image)(target));
                return;

            case 13:
                this.MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 14:
                this.grid_additionalThings = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #9
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.OpenCommand = ((System.Windows.Input.CommandBinding)(target));
     
     #line 28 "..\..\..\MainWindow.xaml"
     this.OpenCommand.CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.OpenCommandCanExecute);
     
     #line default
     #line hidden
     
     #line 28 "..\..\..\MainWindow.xaml"
     this.OpenCommand.Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OpenCommandExecuted);
     
     #line default
     #line hidden
     return;
     case 2:
     this.NewCommand = ((System.Windows.Input.CommandBinding)(target));
     
     #line 29 "..\..\..\MainWindow.xaml"
     this.NewCommand.CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.NewCommandCanExecute);
     
     #line default
     #line hidden
     
     #line 29 "..\..\..\MainWindow.xaml"
     this.NewCommand.Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.NewCommandExecuted);
     
     #line default
     #line hidden
     return;
     case 3:
     this.SaveCommand = ((System.Windows.Input.CommandBinding)(target));
     
     #line 30 "..\..\..\MainWindow.xaml"
     this.SaveCommand.CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.SaveCommandCanExecute);
     
     #line default
     #line hidden
     
     #line 30 "..\..\..\MainWindow.xaml"
     this.SaveCommand.Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.SaveCommandExecuted);
     
     #line default
     #line hidden
     return;
     case 4:
     this.SaveAsCommand = ((System.Windows.Input.CommandBinding)(target));
     
     #line 31 "..\..\..\MainWindow.xaml"
     this.SaveAsCommand.CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.SaveAsCommandCanExecute);
     
     #line default
     #line hidden
     
     #line 31 "..\..\..\MainWindow.xaml"
     this.SaveAsCommand.Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.SaveAsCommandExecuted);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 32 "..\..\..\MainWindow.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.RecentObjectSelected);
     
     #line default
     #line hidden
     return;
     case 6:
     this.AddDivisionCommand = ((System.Windows.Input.CommandBinding)(target));
     
     #line 34 "..\..\..\MainWindow.xaml"
     this.AddDivisionCommand.CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.AddDivisionCommandCanExecute);
     
     #line default
     #line hidden
     
     #line 34 "..\..\..\MainWindow.xaml"
     this.AddDivisionCommand.Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.AddDivisionCommandExecuted);
     
     #line default
     #line hidden
     return;
     case 7:
     this.ApplicationRibbon = ((Fluent.Ribbon)(target));
     return;
     case 8:
     this.FileMenu = ((Fluent.Backstage)(target));
     return;
     case 9:
     this.MenuRecentItem = ((Fluent.BackstageTabItem)(target));
     return;
     case 10:
     this.MenuContextHeaderDivisible = ((Fluent.RibbonContextualTabGroup)(target));
     return;
     case 11:
     this.MenuContextFillable = ((Fluent.RibbonContextualTabGroup)(target));
     return;
     case 12:
     this.TabHome = ((Fluent.RibbonTabItem)(target));
     return;
     case 13:
     this.ButtonPaste = ((Fluent.SplitButton)(target));
     return;
     case 14:
     this.ButtonCut = ((Fluent.Button)(target));
     return;
     case 15:
     this.ButtonCopy = ((Fluent.Button)(target));
     return;
     case 16:
     this.TabDivision = ((Fluent.RibbonTabItem)(target));
     return;
     case 17:
     this.GroupDivision = ((Fluent.RibbonGroupBox)(target));
     return;
     case 18:
     this.ButtonNoDivision = ((Fluent.Button)(target));
     return;
     case 19:
     this.ButtonFess = ((Fluent.Button)(target));
     return;
     case 20:
     this.ButtonPale = ((Fluent.Button)(target));
     return;
     case 21:
     this.ButtonBend = ((Fluent.Button)(target));
     return;
     case 22:
     this.ButtonBendSinister = ((Fluent.Button)(target));
     return;
     case 23:
     this.GroupAdvancedDivision = ((Fluent.RibbonGroupBox)(target));
     return;
     case 24:
     this.ButtonSaltire = ((Fluent.Button)(target));
     return;
     case 25:
     this.ButtonPartyCross = ((Fluent.Button)(target));
     return;
     case 26:
     this.ButtonPall = ((Fluent.Button)(target));
     return;
     case 27:
     this.ButtonTiercedBend = ((Fluent.Button)(target));
     return;
     case 28:
     this.ButtonTiercedBendSinister = ((Fluent.Button)(target));
     return;
     case 29:
     this.ButtonTiercedPale = ((Fluent.Button)(target));
     return;
     case 30:
     this.ButtonTiercedFess = ((Fluent.Button)(target));
     return;
     case 31:
     this.TabOrdinaries = ((Fluent.RibbonTabItem)(target));
     return;
     case 32:
     this.GroupHonourableOrdinaries = ((Fluent.RibbonGroupBox)(target));
     return;
     case 33:
     this.GroupSubOrdinaries = ((Fluent.RibbonGroupBox)(target));
     return;
     case 34:
     this.TabTinctures = ((Fluent.RibbonTabItem)(target));
     return;
     case 35:
     this.GroupLabelBasicTinctures = ((Fluent.RibbonGroupBox)(target));
     return;
     case 36:
     this.ButtonOr = ((Fluent.Button)(target));
     return;
     case 37:
     this.ButtonArgent = ((Fluent.Button)(target));
     return;
     case 38:
     this.ButtonAzure = ((Fluent.Button)(target));
     return;
     case 39:
     this.ButtonVert = ((Fluent.Button)(target));
     return;
     case 40:
     this.ButtonGules = ((Fluent.Button)(target));
     return;
     case 41:
     this.ButtonSable = ((Fluent.Button)(target));
     return;
     case 42:
     this.GroupLabelModernTinctures = ((Fluent.RibbonGroupBox)(target));
     return;
     case 43:
     this.GroupLabelFurs = ((Fluent.RibbonGroupBox)(target));
     return;
     case 44:
     this.GroupLabelCustomTinctures = ((Fluent.RibbonGroupBox)(target));
     return;
     case 45:
     this.StatusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     case 46:
     this.MainFrame = ((GBlason.Control.Aggregate.CustomGUI)(target));
     return;
     }
     this._contentLoaded = true;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.ribbon = ((Fluent.Ribbon)(target));
     return;
     case 2:
     this.backStageTaItemAutoFilter = ((Fluent.BackstageTabItem)(target));
     return;
     case 3:
     this.backStageTaItemDashboard = ((Fluent.BackstageTabItem)(target));
     return;
     case 4:
     this.backStageTaItemCopyPaste = ((Fluent.BackstageTabItem)(target));
     return;
     case 5:
     this.backStageTaItemOther = ((Fluent.BackstageTabItem)(target));
     return;
     }
     this._contentLoaded = true;
 }