Inheritance: System.Windows.Controls.Primitives.ToggleButton
        private static void OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonSplitMenuItem splitMenuItem = (RibbonSplitMenuItem)d;

            RibbonToggleButton toggleButton = splitMenuItem._headerButton as RibbonToggleButton;

            if (toggleButton != null)
            {
                toggleButton.IsChecked = splitMenuItem.IsChecked;
            }
        }
        private static object OnCoerceFocusable(DependencyObject d, object baseValue)
        {
            RibbonToggleButton button = (RibbonToggleButton)d;

            if (button.CoerceFocusable)
            {
                return(false);
            }

            return(baseValue);
        }
Example #3
0
        private Image GetHeaderImage()
        {
            Image        imagePart = null;
            RibbonButton button    = _headerButton as RibbonButton;

            if (button != null)
            {
                imagePart = button.Image;
            }
            else
            {
                RibbonToggleButton toggleButton = _headerButton as RibbonToggleButton;
                if (toggleButton != null)
                {
                    imagePart = toggleButton.Image;
                }
            }
            return(imagePart);
        }
        /// <summary>
        ///   Invoked whenever the control's template is applied.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // Cleanup the previous template elements
            if (_popup != null)
            {
                _popup.Opened -= new EventHandler(this.OnPopupOpened);
            }

            _popup             = this.GetTemplateChild(PopupTemplateName) as Popup;
            SubmenuPlaceholder = this.GetTemplateChild(SubmenuTemplateName) as FrameworkElement;
            _popupToggleButton = this.GetTemplateChild(PopupToggleButtonTemplateName) as RibbonToggleButton;
            _footerPaneHost    = this.GetTemplateChild(FooterPaneTemplateName) as ContentPresenter;
            _auxiliaryPaneHost = this.GetTemplateChild(AuxiliaryPaneTemplateName) as ContentPresenter;

            if (_popup != null)
            {
                _popup.Opened += new EventHandler(this.OnPopupOpened);
            }
        }
        /// <summary>
        ///   Invoked when the QuickAccessToolbar's template is applied.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (_mainPanel != null)
            {
                _mainPanel.Children.Clear();
            }

            if (_overflowPanel != null)
            {
                _overflowPanel.Children.Clear();
            }

            _mainPanel      = GetTemplateChild(MainPanelTemplateName) as RibbonQuickAccessToolBarPanel;
            _overflowPanel  = GetTemplateChild(OverflowPanelTemplateName) as RibbonQuickAccessToolBarOverflowPanel;
            _overflowPopup  = GetTemplateChild(OverflowPopupTemplateName) as Popup;
            _overflowButton = GetTemplateChild(OverflowButtonTemplateName) as RibbonToggleButton;
            if (_overflowButton != null)
            {
                _overflowButton.ToolTipTitle = _overflowButtonToolTipText;
            }

            CoerceValue(DataContextProperty);   // Pick up the Ribbon's DataContext.

            // Set KeyTipAutoGenerationElements property on self.
            IEnumerable <DependencyObject> keyTipAutoGenerationElements = new KeyTipAutoGenerationElements(this);

            KeyTipService.SetKeyTipAutoGenerationElements(this, keyTipAutoGenerationElements);
            if (_overflowPanel != null)
            {
                // Set KeyTipAutoGenerationElements property on overflow panel which helps
                // auto generation of keytips on elements of overflow.
                KeyTipService.SetKeyTipAutoGenerationElements(_overflowPanel, keyTipAutoGenerationElements);
            }
        }
Example #6
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 6 "..\..\..\MainWindow.xaml"
     ((CAGA.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     
     #line 6 "..\..\..\MainWindow.xaml"
     ((CAGA.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.RibbonWindow_Closing);
     
     #line default
     #line hidden
     return;
     case 2:
     this.mainGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.ribbon = ((Microsoft.Windows.Controls.Ribbon.Ribbon)(target));
     return;
     case 4:
     this.RibbonMapGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 5:
     this.OpenMapBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 24 "..\..\..\MainWindow.xaml"
     this.OpenMapBtn.Click += new System.Windows.RoutedEventHandler(this.OpenMapBtn_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.SaveMapBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 25 "..\..\..\MainWindow.xaml"
     this.SaveMapBtn.Click += new System.Windows.RoutedEventHandler(this.SaveMapBtn_Click);
     
     #line default
     #line hidden
     return;
     case 7:
     this.RibbonLayersGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 8:
     this.AddLayerBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 29 "..\..\..\MainWindow.xaml"
     this.AddLayerBtn.Click += new System.Windows.RoutedEventHandler(this.AddLayerBtn_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.RemoveLayerBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 30 "..\..\..\MainWindow.xaml"
     this.RemoveLayerBtn.Click += new System.Windows.RoutedEventHandler(this.RemoveLayerBtn_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.RibbonNavGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 11:
     this.PanMapBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 33 "..\..\..\MainWindow.xaml"
     this.PanMapBtn.Checked += new System.Windows.RoutedEventHandler(this.PanMapBtn_Checked);
     
     #line default
     #line hidden
     
     #line 33 "..\..\..\MainWindow.xaml"
     this.PanMapBtn.Unchecked += new System.Windows.RoutedEventHandler(this.PanMapBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 12:
     this.ZoomInBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 34 "..\..\..\MainWindow.xaml"
     this.ZoomInBtn.Checked += new System.Windows.RoutedEventHandler(this.ZoomInBtn_Checked);
     
     #line default
     #line hidden
     
     #line 34 "..\..\..\MainWindow.xaml"
     this.ZoomInBtn.Unchecked += new System.Windows.RoutedEventHandler(this.ZoomInBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 13:
     this.ZoomOutBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 35 "..\..\..\MainWindow.xaml"
     this.ZoomOutBtn.Checked += new System.Windows.RoutedEventHandler(this.ZoomOutBtn_Checked);
     
     #line default
     #line hidden
     
     #line 35 "..\..\..\MainWindow.xaml"
     this.ZoomOutBtn.Unchecked += new System.Windows.RoutedEventHandler(this.ZoomOutBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 14:
     this.ZoomToExtentBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 36 "..\..\..\MainWindow.xaml"
     this.ZoomToExtentBtn.Click += new System.Windows.RoutedEventHandler(this.ZoomToExtentBtn_Click);
     
     #line default
     #line hidden
     return;
     case 15:
     this.ZoomToPrevBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 37 "..\..\..\MainWindow.xaml"
     this.ZoomToPrevBtn.Click += new System.Windows.RoutedEventHandler(this.ZoomToPrevBtn_Click);
     
     #line default
     #line hidden
     return;
     case 16:
     this.ZoomToNextBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 38 "..\..\..\MainWindow.xaml"
     this.ZoomToNextBtn.Click += new System.Windows.RoutedEventHandler(this.ZoomToNextBtn_Click);
     
     #line default
     #line hidden
     return;
     case 17:
     this.ZoomToLayerBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 39 "..\..\..\MainWindow.xaml"
     this.ZoomToLayerBtn.Click += new System.Windows.RoutedEventHandler(this.ZoomToLayerBtn_Click);
     
     #line default
     #line hidden
     return;
     case 18:
     this.RibbonSelectionGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 19:
     this.SelectFeatureBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonSplitButton)(target));
     
     #line 42 "..\..\..\MainWindow.xaml"
     this.SelectFeatureBtn.Click += new System.Windows.RoutedEventHandler(this.SelectFeatureBtn_Click);
     
     #line default
     #line hidden
     return;
     case 20:
     this.SelectFeatureGallery = ((Microsoft.Windows.Controls.Ribbon.RibbonGallery)(target));
     return;
     case 21:
     this.SelByRectItem = ((Microsoft.Windows.Controls.Ribbon.RibbonGalleryItem)(target));
     
     #line 45 "..\..\..\MainWindow.xaml"
     this.SelByRectItem.Selected += new System.Windows.RoutedEventHandler(this.SelectFeatureItem_Selected);
     
     #line default
     #line hidden
     return;
     case 22:
     this.SelByPolyItem = ((Microsoft.Windows.Controls.Ribbon.RibbonGalleryItem)(target));
     
     #line 46 "..\..\..\MainWindow.xaml"
     this.SelByPolyItem.Selected += new System.Windows.RoutedEventHandler(this.SelectFeatureItem_Selected);
     
     #line default
     #line hidden
     return;
     case 23:
     this.SelByCircleItem = ((Microsoft.Windows.Controls.Ribbon.RibbonGalleryItem)(target));
     
     #line 47 "..\..\..\MainWindow.xaml"
     this.SelByCircleItem.Selected += new System.Windows.RoutedEventHandler(this.SelectFeatureItem_Selected);
     
     #line default
     #line hidden
     return;
     case 24:
     this.SelByLineItem = ((Microsoft.Windows.Controls.Ribbon.RibbonGalleryItem)(target));
     
     #line 48 "..\..\..\MainWindow.xaml"
     this.SelByLineItem.Selected += new System.Windows.RoutedEventHandler(this.SelectFeatureItem_Selected);
     
     #line default
     #line hidden
     return;
     case 25:
     this.SelectByGraphicsBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 52 "..\..\..\MainWindow.xaml"
     this.SelectByGraphicsBtn.Click += new System.Windows.RoutedEventHandler(this.SelectByGraphicsBtn_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.UnselectFeatureBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 53 "..\..\..\MainWindow.xaml"
     this.UnselectFeatureBtn.Click += new System.Windows.RoutedEventHandler(this.UnselectFeatureBtn_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.RibbonToolsGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 28:
     this.IdentifyFeatureBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 56 "..\..\..\MainWindow.xaml"
     this.IdentifyFeatureBtn.Checked += new System.Windows.RoutedEventHandler(this.IdentifyFeatureBtn_Checked);
     
     #line default
     #line hidden
     
     #line 56 "..\..\..\MainWindow.xaml"
     this.IdentifyFeatureBtn.Unchecked += new System.Windows.RoutedEventHandler(this.IdentifyFeatureBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 29:
     this.AttrTableBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 57 "..\..\..\MainWindow.xaml"
     this.AttrTableBtn.Click += new System.Windows.RoutedEventHandler(this.AttrTableBtn_Click);
     
     #line default
     #line hidden
     return;
     case 30:
     this.RibbonDrawingGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 31:
     this.DrawPolygonBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 60 "..\..\..\MainWindow.xaml"
     this.DrawPolygonBtn.Checked += new System.Windows.RoutedEventHandler(this.DrawPolygonBtn_Checked);
     
     #line default
     #line hidden
     
     #line 60 "..\..\..\MainWindow.xaml"
     this.DrawPolygonBtn.Unchecked += new System.Windows.RoutedEventHandler(this.DrawPolygonBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 32:
     this.RibbonDlgMgrGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 33:
     this.ToggleDlgBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 66 "..\..\..\MainWindow.xaml"
     this.ToggleDlgBtn.Click += new System.Windows.RoutedEventHandler(this.ToggleDlgBtn_Click);
     
     #line default
     #line hidden
     return;
     case 34:
     this.RibbonSpeechRecGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 35:
     this.ToggleSpeechBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 69 "..\..\..\MainWindow.xaml"
     this.ToggleSpeechBtn.Click += new System.Windows.RoutedEventHandler(this.ToggleSpeechBtn_Click);
     
     #line default
     #line hidden
     return;
     case 36:
     this.SimSpeechBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 70 "..\..\..\MainWindow.xaml"
     this.SimSpeechBtn.Click += new System.Windows.RoutedEventHandler(this.SimSpeechBtn_Click);
     
     #line default
     #line hidden
     return;
     case 37:
     this.dockManager = ((AvalonDock.DockingManager)(target));
     return;
     case 38:
     this.LayersPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 39:
     this.tocGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 40:
     
     #line 84 "..\..\..\MainWindow.xaml"
     ((AvalonDock.DocumentPane)(target)).SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.DocumentPane_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 41:
     this.MapPanel = ((AvalonDock.DocumentContent)(target));
     return;
     case 42:
     this.mapGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 43:
     this.LayoutPanel = ((AvalonDock.DocumentContent)(target));
     return;
     case 44:
     this.layoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 45:
     this.KinectCtrlPanel = ((AvalonDock.DockablePane)(target));
     return;
     case 46:
     this.ColorDisplayPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 47:
     this.colorDisplay = ((System.Windows.Controls.Image)(target));
     return;
     case 48:
     this.skeletonCanvas = ((System.Windows.Controls.Canvas)(target));
     return;
     case 49:
     this.DepthDisplayPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 50:
     this.depthDisplay = ((System.Windows.Controls.Image)(target));
     return;
     case 51:
     this.DevCtrlPanel = ((AvalonDock.DockablePane)(target));
     return;
     case 52:
     this.statusTB = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #7
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.saveScriptBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target));
     return;
     case 2:
     this.exitMenuBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target));
     
     #line 105 "..\..\..\Designer.xaml"
     this.exitMenuBtn.Click += new System.Windows.RoutedEventHandler(this.exitMenuBtn_Click);
     
     #line default
     #line hidden
     return;
     case 3:
     this.HomeTab = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target));
     return;
     case 4:
     this.Clear = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 5:
     this.deleteStep = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 122 "..\..\..\Designer.xaml"
     this.deleteStep.Click += new System.Windows.RoutedEventHandler(this.deleteStep_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.RefreshBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 7:
     this.Duplicate = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 8:
     this.CutStep = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 149 "..\..\..\Designer.xaml"
     this.CutStep.Click += new System.Windows.RoutedEventHandler(this.CutStep_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.CopyStep = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 153 "..\..\..\Designer.xaml"
     this.CopyStep.Click += new System.Windows.RoutedEventHandler(this.CopyStep_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.PasteStep = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 11:
     this.moveUp = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 171 "..\..\..\Designer.xaml"
     this.moveUp.Click += new System.Windows.RoutedEventHandler(this.moveUp_Click);
     
     #line default
     #line hidden
     return;
     case 12:
     this.moveDw = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 177 "..\..\..\Designer.xaml"
     this.moveDw.Click += new System.Windows.RoutedEventHandler(this.moveDw_Click);
     
     #line default
     #line hidden
     return;
     case 13:
     this.debugBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 197 "..\..\..\Designer.xaml"
     this.debugBtn.Click += new System.Windows.RoutedEventHandler(this.debugBtn_Click);
     
     #line default
     #line hidden
     return;
     case 14:
     this.runBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 231 "..\..\..\Designer.xaml"
     this.runBtn.Click += new System.Windows.RoutedEventHandler(this.runBtn_Click);
     
     #line default
     #line hidden
     return;
     case 15:
     this.reportBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 265 "..\..\..\Designer.xaml"
     this.reportBtn.Click += new System.Windows.RoutedEventHandler(this.reportBtn_Click);
     
     #line default
     #line hidden
     return;
     case 16:
     this.aboutBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 270 "..\..\..\Designer.xaml"
     this.aboutBtn.Click += new System.Windows.RoutedEventHandler(this.aboutBtn_Click);
     
     #line default
     #line hidden
     return;
     case 17:
     this.settingBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 18:
     this.myDock = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
     return;
     case 19:
     this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
     return;
     case 20:
     this.TestListGrid = ((System.Windows.Controls.DataGrid)(target));
     
     #line 364 "..\..\..\Designer.xaml"
     this.TestListGrid.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.TestListGrid_LoadingRow);
     
     #line default
     #line hidden
     
     #line 366 "..\..\..\Designer.xaml"
     this.TestListGrid.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.TestListGrid_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 22:
     this.suiteDescriptionTxb = ((System.Windows.Controls.TextBox)(target));
     return;
     case 23:
     this.ClearTearSuiteDownBtn = ((System.Windows.Controls.Button)(target));
     
     #line 432 "..\..\..\Designer.xaml"
     this.ClearTearSuiteDownBtn.Click += new System.Windows.RoutedEventHandler(this.ClearTearSuiteDownBtn_Click);
     
     #line default
     #line hidden
     return;
     case 24:
     this.treeView11 = ((System.Windows.Controls.TreeView)(target));
     return;
     case 25:
     this.stackTree = ((System.Windows.Controls.StackPanel)(target));
     
     #line 773 "..\..\..\Designer.xaml"
     this.stackTree.RequestBringIntoView += new System.Windows.RequestBringIntoViewEventHandler(this.stackTree_RequestBringIntoView);
     
     #line default
     #line hidden
     return;
     case 26:
     this.searchControl = ((AutomationClient.SerachUserControl)(target));
     return;
     case 27:
     this.ScriptsTreeView = ((System.Windows.Controls.TreeView)(target));
     
     #line 779 "..\..\..\Designer.xaml"
     this.ScriptsTreeView.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.ScriptsTreeView_PreviewMouseWheel);
     
     #line default
     #line hidden
     return;
     case 30:
     this.scriptGroupBox = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 31:
     this.dgStepEntities = ((System.Windows.Controls.DataGrid)(target));
     
     #line 950 "..\..\..\Designer.xaml"
     this.dgStepEntities.Loaded += new System.Windows.RoutedEventHandler(this.dgStepEntities_Loaded);
     
     #line default
     #line hidden
     
     #line 951 "..\..\..\Designer.xaml"
     this.dgStepEntities.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgStepEntities_LoadingRow);
     
     #line default
     #line hidden
     
     #line 952 "..\..\..\Designer.xaml"
     this.dgStepEntities.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.dgStepEntities_MouseDoubleClick);
     
     #line default
     #line hidden
     
     #line 954 "..\..\..\Designer.xaml"
     this.dgStepEntities.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgStepEntities_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 34:
     this.scriptDescriptionTxb = ((System.Windows.Controls.TextBox)(target));
     return;
     case 35:
     this.testDescriptionTxb = ((System.Windows.Controls.TextBox)(target));
     return;
     case 36:
     this.testDataGrid = ((System.Windows.Controls.DataGrid)(target));
     
     #line 1162 "..\..\..\Designer.xaml"
     this.testDataGrid.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.testDataGrid_LoadingRow);
     
     #line default
     #line hidden
     
     #line 1165 "..\..\..\Designer.xaml"
     this.testDataGrid.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.DataGrid_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 38:
     this.autoScrollChk = ((System.Windows.Controls.CheckBox)(target));
     
     #line 1281 "..\..\..\Designer.xaml"
     this.autoScrollChk.Click += new System.Windows.RoutedEventHandler(this.autoScrollChk_Click);
     
     #line default
     #line hidden
     return;
     case 39:
     this.executionDatagrid = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 40:
     this.variablesDataGrid = ((System.Windows.Controls.DataGrid)(target));
     
     #line 1406 "..\..\..\Designer.xaml"
     this.variablesDataGrid.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.variablesDataGrid_MouseDoubleClick);
     
     #line default
     #line hidden
     return;
     case 41:
     this.varDataTxb = ((System.Windows.Controls.TextBox)(target));
     return;
     case 42:
     this.statusBar1 = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #8
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 13 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.New);
     
     #line default
     #line hidden
     return;
     case 2:
     
     #line 14 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Open);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 17 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Save);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 18 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveAs);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 22 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RedoScript);
     
     #line default
     #line hidden
     return;
     case 6:
     
     #line 23 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonMenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.UndoScript);
     
     #line default
     #line hidden
     return;
     case 7:
     
     #line 26 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Refresh);
     
     #line default
     #line hidden
     return;
     case 8:
     this.RowDetailToggleButton = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     return;
     case 9:
     this.RedoToggleButton = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     return;
     case 10:
     this.UndoToggleButton = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     return;
     case 11:
     
     #line 38 "..\..\MainWindow.xaml"
     ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.About);
     
     #line default
     #line hidden
     return;
     case 12:
     this.From = ((System.Windows.Controls.DatePicker)(target));
     return;
     case 13:
     this.To = ((System.Windows.Controls.DatePicker)(target));
     return;
     case 14:
     this.TransactionLogGrid = ((System.Windows.Controls.DataGrid)(target));
     
     #line 56 "..\..\MainWindow.xaml"
     this.TransactionLogGrid.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.OnSelectedRowChanged);
     
     #line default
     #line hidden
     return;
     case 15:
     this.RowDetailsGrid = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 16:
     this.RedoTextBlock = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 17:
     this.UndoTextBlock = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mainWindow = ((ScoreEditor_WPF_Version.MainWindow)(target));
                return;

            case 2:
                this.RootStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.Ribbon = ((Microsoft.Windows.Controls.Ribbon.Ribbon)(target));
                return;

            case 4:
                this.About = ((Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target));

            #line 29 "..\..\..\MainWindow.xaml"
                this.About.Click += new System.Windows.RoutedEventHandler(this.About_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.HomeTab = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target));
                return;

            case 6:
                this.NewOpenSave = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 7:
                this.New_ButtonDialog = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 39 "..\..\..\MainWindow.xaml"
                this.New_ButtonDialog.Click += new System.Windows.RoutedEventHandler(this.New_ButtonDialog_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.Open_Button = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 43 "..\..\..\MainWindow.xaml"
                this.Open_Button.Click += new System.Windows.RoutedEventHandler(this.Open_Button_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.Save_Button = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

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

            #line default
            #line hidden
                return;

            case 10:
                this.View = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 11:
                this.zoomIn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 58 "..\..\..\MainWindow.xaml"
                this.zoomIn.Click += new System.Windows.RoutedEventHandler(this.zoomIn_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.zoomOut = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 62 "..\..\..\MainWindow.xaml"
                this.zoomOut.Click += new System.Windows.RoutedEventHandler(this.zoomOut_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.zoomAll = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 65 "..\..\..\MainWindow.xaml"
                this.zoomAll.Click += new System.Windows.RoutedEventHandler(this.zoomAll_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.PlayGroup = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 15:
                this.play = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 74 "..\..\..\MainWindow.xaml"
                this.play.Click += new System.Windows.RoutedEventHandler(this.play_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.stop = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));

            #line 78 "..\..\..\MainWindow.xaml"
                this.stop.Click += new System.Windows.RoutedEventHandler(this.stop_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.InsertTab = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target));
                return;

            case 18:
                this.InsertReplaceDeleteGroup = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 19:
                this.Add = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 91 "..\..\..\MainWindow.xaml"
                this.Add.Checked += new System.Windows.RoutedEventHandler(this.InsertReplaceDelete_Checked);

            #line default
            #line hidden
                return;

            case 20:
                this.Insert = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 95 "..\..\..\MainWindow.xaml"
                this.Insert.Checked += new System.Windows.RoutedEventHandler(this.InsertReplaceDelete_Checked);

            #line default
            #line hidden
                return;

            case 21:
                this.Delete = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 99 "..\..\..\MainWindow.xaml"
                this.Delete.Checked += new System.Windows.RoutedEventHandler(this.InsertReplaceDelete_Checked);

            #line default
            #line hidden
                return;

            case 22:
                this.NotesGroup = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 23:
                this._whole = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 106 "..\..\..\MainWindow.xaml"
                this._whole.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 24:
                this._half = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 109 "..\..\..\MainWindow.xaml"
                this._half.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 25:
                this._quarter = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 112 "..\..\..\MainWindow.xaml"
                this._quarter.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 26:
                this._eighth = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 115 "..\..\..\MainWindow.xaml"
                this._eighth.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 27:
                this._16th = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 118 "..\..\..\MainWindow.xaml"
                this._16th.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 28:
                this._32nd = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 121 "..\..\..\MainWindow.xaml"
                this._32nd.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 29:
                this.Rest_whole = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 125 "..\..\..\MainWindow.xaml"
                this.Rest_whole.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 30:
                this.Rest_half = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 128 "..\..\..\MainWindow.xaml"
                this.Rest_half.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 31:
                this.Rest_quarter = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 131 "..\..\..\MainWindow.xaml"
                this.Rest_quarter.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 32:
                this.Rest_eighth = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 134 "..\..\..\MainWindow.xaml"
                this.Rest_eighth.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 33:
                this.Rest_16th = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 137 "..\..\..\MainWindow.xaml"
                this.Rest_16th.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 34:
                this.Rest_32nd = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));

            #line 140 "..\..\..\MainWindow.xaml"
                this.Rest_32nd.Checked += new System.Windows.RoutedEventHandler(this.Notes_Checked);

            #line default
            #line hidden
                return;

            case 35:
                this.LyricSlurBeam = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
                return;

            case 36:
                this.beam = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 37:
                this.slur = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 38:
                this.dot = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 39:
                this.sharp = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 40:
                this.flat = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 41:
                this.natural = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 42:
                this.lyrics = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
                return;

            case 43:
                this.newgrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 44:
                this.TitleLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 45:
                this.TitleTxtBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 46:
                this.InstrumentLable = ((System.Windows.Controls.Label)(target));
                return;

            case 47:
                this.InstrumentTxtBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 48:
                this.keysiglistbox = ((System.Windows.Controls.ListBox)(target));
                return;

            case 49:
                this.KeySigLable = ((System.Windows.Controls.Label)(target));
                return;

            case 50:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 51:
                this.TimesBeat = ((Xceed.Wpf.Toolkit.IntegerUpDown)(target));
                return;

            case 52:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 53:
                this.BeatType = ((Xceed.Wpf.Toolkit.IntegerUpDown)(target));

            #line 248 "..\..\..\MainWindow.xaml"
                this.BeatType.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.BeatType_ValueChanged);

            #line default
            #line hidden
                return;

            case 54:
                this.StaffLengthLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 55:
                this.StaffLength = ((Xceed.Wpf.Toolkit.IntegerUpDown)(target));
                return;

            case 56:
                this.CreateBtn = ((System.Windows.Controls.Button)(target));

            #line 253 "..\..\..\MainWindow.xaml"
                this.CreateBtn.Click += new System.Windows.RoutedEventHandler(this.CreateBtn_Click);

            #line default
            #line hidden
                return;

            case 57:
                this.CancelBtn = ((System.Windows.Controls.Button)(target));

            #line 254 "..\..\..\MainWindow.xaml"
                this.CancelBtn.Click += new System.Windows.RoutedEventHandler(this.CancelBtn_Click);

            #line default
            #line hidden
                return;

            case 58:
                this.ClefLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 59:
                this.ClefCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 60:
                this.ScoreScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 61:
                this.MainViewbox = ((System.Windows.Controls.Viewbox)(target));
                return;

            case 62:
                this.OverlapedGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 63:
                this.StaffStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 64:
                this.NotesWrappanel = ((System.Windows.Controls.WrapPanel)(target));
                return;

            case 65:
                this.TopCanvas = ((System.Windows.Controls.Canvas)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private static void translateLabel(RibbonToggleButton button, string name, params string[] variables) {
            StringCollection str = Strings.getInterfaceString(name);
            if (str[StringType.Label].HasHotKey) {
                button.KeyTip = str[StringType.Label].HotKey;
            }

            button.Label = str[StringType.Label].interpret(variables);

            if (str.ContainsKey(StringType.ToolTip)) {
                button.ToolTip = str[StringType.ToolTip].interpret(variables);
            }
        }
 private static void translateLabel(RibbonToggleButton button) {
     if (button.Label == null)
         return;
     string string_title = button.Label.ToString();
     translateLabel(button, string_title);
 }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (_headerButton != null)
            {
                _headerButton.Click -= new RoutedEventHandler(OnHeaderClicked);
            }
            _headerButton = GetTemplateChild(HeaderButtonTemplatePart) as ButtonBase;

            if (_headerButton != null)
            {
                _headerButton.Click += new RoutedEventHandler(OnHeaderClicked);
            }

            _partArrowButton = GetTemplateChild(ArrowButtonTemplatePart) as RibbonToggleButton;
            _highlightLeftBorder = GetTemplateChild("HighlightLeftBorder") as Border;
            _highlightRightBorder = GetTemplateChild("HighlightRightBorder") as Border;

            SetIsPressedBinding();
            SetBorderThickness();
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 40 "..\..\..\MainWindow.xaml"
     ((SBW2.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.RibbonWindowClosing);
     
     #line default
     #line hidden
     return;
     case 2:
     this.StartStopQAB = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 3:
     this.StartRB = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 4:
     this.StopRB = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 5:
     this.RestartRB = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     return;
     case 6:
     this.Ribbon_Status = ((Microsoft.Windows.Controls.Ribbon.RibbonTwoLineText)(target));
     return;
     case 7:
     this.MemStats = ((Microsoft.Windows.Controls.Ribbon.RibbonTwoLineText)(target));
     return;
     case 8:
     this.Uptime = ((Microsoft.Windows.Controls.Ribbon.RibbonTwoLineText)(target));
     return;
     case 9:
     this.memcb = ((Microsoft.Windows.Controls.Ribbon.RibbonComboBox)(target));
     return;
     case 10:
     this.memboxGal = ((Microsoft.Windows.Controls.Ribbon.RibbonGallery)(target));
     
     #line 103 "..\..\..\MainWindow.xaml"
     this.memboxGal.SelectionChanged += new System.Windows.RoutedPropertyChangedEventHandler<object>(this.MemoryComboBoxSelectionChanged);
     
     #line default
     #line hidden
     return;
     case 11:
     this.MemoryComboBox = ((Microsoft.Windows.Controls.Ribbon.RibbonGalleryCategory)(target));
     return;
     case 12:
     this.NetworkToggle = ((Microsoft.Windows.Controls.Ribbon.RibbonToggleButton)(target));
     
     #line 118 "..\..\..\MainWindow.xaml"
     this.NetworkToggle.Checked += new System.Windows.RoutedEventHandler(this.NetToggleChecked);
     
     #line default
     #line hidden
     
     #line 119 "..\..\..\MainWindow.xaml"
     this.NetworkToggle.Unchecked += new System.Windows.RoutedEventHandler(this.NetworkToggleUnchecked);
     
     #line default
     #line hidden
     return;
     case 13:
     this.outputBox = ((System.Windows.Controls.RichTextBox)(target));
     return;
     case 14:
     this.inputBox = ((System.Windows.Controls.TextBox)(target));
     
     #line 138 "..\..\..\MainWindow.xaml"
     this.inputBox.KeyDown += new System.Windows.Input.KeyEventHandler(this.TextBoxKeyDown);
     
     #line default
     #line hidden
     return;
     case 15:
     this.StartThumb = ((System.Windows.Shell.ThumbButtonInfo)(target));
     return;
     case 16:
     this.StopThumb = ((System.Windows.Shell.ThumbButtonInfo)(target));
     return;
     case 17:
     this.RestartThumb = ((System.Windows.Shell.ThumbButtonInfo)(target));
     return;
     }
     this._contentLoaded = true;
 }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (_headerButton != null)
            {
                _headerButton.Click -= new RoutedEventHandler(OnHeaderClicked);
            }
            _headerButton = GetTemplateChild(RibbonSplitButton.HeaderButtonTemplatePartName) as ButtonBase;

            if (_headerButton != null)
            {
                _headerButton.Click += new RoutedEventHandler(OnHeaderClicked);
            }

            // Set BorderThickess on TemplateParts
            SetBorderThickess();

            PropertyHelper.TransferProperty(this, ContextMenuProperty);   // Coerce to get a default ContextMenu if none has been specified.
            PropertyHelper.TransferProperty(this, RibbonControlService.CanAddToQuickAccessToolBarDirectlyProperty);

            _toggleButton = GetTemplateChild(RibbonSplitButton.ToggleButtonTemplatePartName) as RibbonToggleButton;
        }
 /// <summary>
 ///   Defer to the base class for initialization
 /// </summary>
 public RibbonToggleButtonAutomationPeer(RibbonToggleButton owner)
     : base(owner)
 {
 }
        protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
        {
            TemplateApplied = false;
            base.OnTemplateChanged(oldTemplate, newTemplate);

            if ((oldTemplate != null) && (_partToggleButton != null))
            {
                RibbonHelper.ClearPseudoInheritedProperties(_partToggleButton);
                _partToggleButton = null;
            }
        }
        public override void OnApplyTemplate()
        {
            CoerceValue(ControlSizeDefinitionProperty);
            base.OnApplyTemplate();

            if (_resizeThumb != null)
            {
                _resizeThumb.DragStarted -= new DragStartedEventHandler(OnPopupResizeStarted);
                _resizeThumb.DragDelta -= new DragDeltaEventHandler(OnPopupResize);
            }

            _resizeThumb = GetTemplateChild(ResizeThumbTemplatePartName) as Thumb;
            if (_resizeThumb != null)
            {
                _resizeThumb.DragStarted += new DragStartedEventHandler(OnPopupResizeStarted);
                _resizeThumb.DragDelta += new DragDeltaEventHandler(OnPopupResize);
            }

            _itemsPresenter = GetTemplateChild(ItemsPresenterTemplatePartName) as ItemsPresenter;
            _partToggleButton = GetTemplateChild(ToggleButtonTemplatePartName) as RibbonToggleButton;
            _popup = GetTemplateChild(PopupTemplatePartName) as Popup;
            _popupRoot = null;

            TransferPseudoInheritedProperties();

            PropertyHelper.TransferProperty(this, ContextMenuProperty);   // Coerce to get a default ContextMenu if none has been specified.
            PropertyHelper.TransferProperty(this, RibbonControlService.CanAddToQuickAccessToolBarDirectlyProperty);
            TemplateApplied = true;

            ItemContainerGenerator.StatusChanged += new EventHandler(OnItemContainerGeneratorStatusChanged);

            _submenuScrollViewer = GetTemplateChild(SubMenuScrollViewerTemplatePartName) as ScrollViewer;
            if (_submenuScrollViewer != null)
            {
                KeyTipService.SetCanClipKeyTip(_submenuScrollViewer, false);
            }
        }
        private static Control MapQatDataToControl(VM.QatItem qatItem)
        {
            string typeName = qatItem.Instance.GetType().Name;
            Control control = null;

            switch (typeName)
            {
                case "ButtonData":
                    {
                        control = new RibbonButton();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "ToggleButtonData":
                    {
                        control = new RibbonToggleButton();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "RadioButtonData":
                    {
                        control = new RibbonRadioButton();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "CheckBoxData":
                    {
                        control = new RibbonCheckBox();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "TextBoxData":
                    {
                        control = new RibbonTextBox();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "MenuButtonData":
                    {
                        control = new RibbonMenuButton();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "SplitButtonData":
                    {
                        if (!qatItem.IsSplitHeader)
                        {
                            control = new RibbonSplitButton();
                        }
                        else
                        {
                            VM.SplitButtonData splitButtonData = (VM.SplitButtonData)qatItem.Instance;
                            if (splitButtonData.IsCheckable)
                            {
                                control = new RibbonToggleButton();
                            }
                            else
                            {
                                control = new RibbonButton();
                            }
                        }
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "ComboBoxData":
                    {
                        control = new RibbonComboBox();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "MenuItemData":
                    {
                        VM.MenuItemData menuItemData = (VM.MenuItemData)qatItem.Instance;
                        if (menuItemData.ControlDataCollection.Count > 0)
                        {
                            control = new RibbonMenuButton();
                        }
                        else
                        {
                            control = new RibbonButton();
                        }
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "SplitMenuItemData":
                    {
                        VM.SplitMenuItemData splitMenuItemData = (VM.SplitMenuItemData)qatItem.Instance;
                        if (!qatItem.IsSplitHeader)
                        {
                            if (splitMenuItemData.ControlDataCollection.Count > 0)
                            {
                                control = new RibbonSplitButton();
                            }
                            else if (splitMenuItemData.IsCheckable)
                            {
                                control = new RibbonToggleButton();
                            }
                            else
                            {
                                control = new RibbonButton();
                            }
                        }
                        else
                        {
                            control = new RibbonToggleButton();
                        }
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "GalleryData":
                    {
                        RibbonGallery gallery = new RibbonGallery();
                        RibbonMenuButton menuButton = new RibbonMenuButton();
                        menuButton.ItemsSource = new object[] { gallery };

                        control = menuButton;
                        control.DataContext = qatItem.Instance;
                        break;
                    }
                case "GroupData":
                    {
                        control = new RibbonGroup();
                        control.DataContext = qatItem.Instance;
                        break;
                    }
            }

            return control;
        }
        /// <summary>
        ///   Invoked whenever the control's template is applied.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // Cleanup the previous template elements
            if (_popup != null)
            {
                _popup.Opened -= new EventHandler(this.OnPopupOpened);
            }

            _popup = this.GetTemplateChild(PopupTemplateName) as Popup;
            SubmenuPlaceholder = this.GetTemplateChild(SubmenuTemplateName) as FrameworkElement;
            _popupToggleButton = this.GetTemplateChild(PopupToggleButtonTemplateName) as RibbonToggleButton;
            _footerPaneHost = this.GetTemplateChild(FooterPaneTemplateName) as ContentPresenter;
            _auxiliaryPaneHost = this.GetTemplateChild(AuxiliaryPaneTemplateName) as ContentPresenter;

            if (_popup != null)
            {
                _popup.Opened += new EventHandler(this.OnPopupOpened);
            }
        }