Inheritance: System.Windows.Controls.ItemsControl, IQuickAccessItemProvider
Example #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Group = ((Fluent.RibbonGroupBox)(target));
                return;

            case 2:
                this.spinner = ((Fluent.Spinner)(target));
                return;

            case 3:
                this.buttonGreen = ((Fluent.Button)(target));
                return;

            case 4:
                this.buttonGray = ((Fluent.Button)(target));
                return;

            case 5:
                this.buttonYellow = ((Fluent.Button)(target));
                return;

            case 6:
                this.buttonBrown = ((Fluent.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
        //Convert wird für die Konvertierung in das Display-Format verwendet
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ObservableCollection<RibbonTabItem> tabItems = new ObservableCollection<RibbonTabItem>();

            IEnumerable<ITixMenuTabItem> menuItem = value as IEnumerable<ITixMenuTabItem>;
            if (menuItem != null)
            {
                foreach (var tab in menuItem)
                {
                    RibbonTabItem tabItem = new RibbonTabItem();
                    tabItem.Header = tab.Header;
                    foreach (var group in tab.Groups)
                    {
                        RibbonGroupBox groupBox = new RibbonGroupBox();
                        groupBox.Header = group.Header;
                        foreach (var button in group.Buttons)
                        {
                            Button fluentButton = new Button();
                            fluentButton.Header = button.Header;
                            fluentButton.Command = button.Command;
                            groupBox.Items.Add(fluentButton);
                        }
                        tabItem.Groups.Add(groupBox);
                    }
                    tabItems.Add(tabItem);
                }
            }
            return tabItems;
        }
Example #3
0
        // We have to reset the reduce order to it's initial value, clear all caches we keep here and invalidate measure/arrange
#pragma warning disable CA1801 // Review unused parameters
        internal void GroupBoxCacheClearedAndStateAndScaleResetted(RibbonGroupBox ribbonGroupBox)
#pragma warning restore CA1801 // Review unused parameters
        {
            var ribbonPanel = this;

            var newReduceOrderIndex = ribbonPanel.reduceOrder.Length - 1;

            ribbonPanel.reduceOrderIndex = newReduceOrderIndex;

            this.measureCache = default;

            foreach (var item in this.InternalChildren)
            {
                var groupBox = item as RibbonGroupBox;
                if (groupBox is null)
                {
                    continue;
                }

                groupBox.TryClearCacheAndResetStateAndScale();
            }

            ribbonPanel.InvalidateMeasure();
            ribbonPanel.InvalidateArrange();
        }
Example #4
0
        /// <summary>
        /// On state property changed
        /// </summary>
        /// <param name="d">Object</param>
        /// <param name="e">The event data</param>
        static void StatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonGroupBox ribbonGroupBox = (RibbonGroupBox)d;
            RibbonGroupBoxState ribbonGroupBoxState = (RibbonGroupBoxState)e.NewValue;

            SetChildSizes(ribbonGroupBoxState, ribbonGroupBox);
        }
Example #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((Fluent.Sample.Galleries.Window)(target));
                return;

            case 2:
                this.A = ((Fluent.RibbonGroupBox)(target));
                return;

            case 3:
                this.buttonGreen = ((Fluent.DropDownButton)(target));
                return;

            case 4:
                this.B = ((Fluent.RibbonGroupBox)(target));
                return;

            case 5:
                this.inRibbonGallery = ((Fluent.InRibbonGallery)(target));
                return;

            case 6:
                this.galleryFilterAll = ((Fluent.GalleryGroupFilter)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #6
0
 // Set child sizes
 private static void SetChildSizes(RibbonGroupBoxState ribbonGroupBoxState, RibbonGroupBox ribbonGroupBox)
 {
     for (int i = 0; i < ribbonGroupBox.Items.Count; i++)
     {
         SetAppropriateSizeRecursive((UIElement)ribbonGroupBox.Items[i], ribbonGroupBoxState);
         //RibbonControl.SetAppropriateSize((UIElement)ribbonGroupBox.Items[i], ribbonGroupBoxState);
     }
 }
Example #7
0
 static void OnDialogLauncherButtonKeyTipKeysChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     RibbonGroupBox ribbonGroupBox = (RibbonGroupBox)d;
     if (ribbonGroupBox.LauncherButton != null)
     {
         KeyTip.SetKeys(ribbonGroupBox.LauncherButton, (string)e.NewValue);
     }
 }
Example #8
0
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            var groupBox = new RibbonGroupBox();

            RibbonControl.BindQuickAccessItem(this, groupBox);

            groupBox.DropDownOpened += this.OnQuickAccessOpened;
            groupBox.DropDownClosed += this.OnQuickAccessClosed;

            groupBox.State = RibbonGroupBoxState.QuickAccess;

            RibbonControl.Bind(this, groupBox, "ItemTemplateSelector", ItemTemplateSelectorProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "ItemTemplate", ItemTemplateProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "ItemsSource", ItemsSourceProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommandParameter", LauncherCommandParameterProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommand", LauncherCommandProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommandTarget", LauncherCommandTargetProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherIcon", LauncherIconProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherText", LauncherTextProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherToolTip", LauncherToolTipProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "IsLauncherEnabled", IsLauncherEnabledProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "IsLauncherVisible", IsLauncherVisibleProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "DialogLauncherButtonKeyTipKeys", DialogLauncherButtonKeyTipKeysProperty, BindingMode.OneWay);
            groupBox.LauncherClick += this.LauncherClick;

            var toolTip = this.ToolTip as ToolTip;

            if ((toolTip == null || toolTip.ToolTip == null) && this.Header != null)
            {
                RibbonControl.Bind(this, groupBox, "Header", ToolTipProperty, BindingMode.OneWay);
            }

            if (this.Icon != null)
            {
                var iconVisual = this.Icon as Visual;
                if (iconVisual != null)
                {
                    var rect = new Rectangle
                    {
                        Width  = 16,
                        Height = 16,
                        Fill   = new VisualBrush(iconVisual)
                    };
                    groupBox.Icon = rect;
                }
                else
                {
                    RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);
                }
            }

            if (this.Header != null)
            {
                RibbonControl.Bind(this, groupBox, "Header", RibbonControl.HeaderProperty, BindingMode.OneWay);
            }

            return(groupBox);
        }
Example #9
0
        private static object CoerceIsDropDownOpen(DependencyObject d, object basevalue)
        {
            RibbonGroupBox box = d as RibbonGroupBox;

            if ((box.State != RibbonGroupBoxState.Collapsed) && (box.State != RibbonGroupBoxState.QuickAccess))
            {
                return(false);
            }
            return(basevalue);
        }
Example #10
0
        /// <summary>
        /// Handles IsOpen propertyu changes
        /// </summary>
        /// <param name="d">Object</param>
        /// <param name="e">The event data</param>
        static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonGroupBox ribbon = (RibbonGroupBox)d;

            if (ribbon.IsOpen)
            {
                ribbon.OnRibbonGroupBoxPopupOpening();
            }
            else
            {
                ribbon.OnRibbonGroupBoxPopupClosing();
            }
        }
Example #11
0
        private void OnQuickAccessClosed(object sender, EventArgs e)
        {
            RibbonGroupBox groupBox = sender as RibbonGroupBox;

            for (int i = 0; i < groupBox.Items.Count; i++)
            {
                object item = groupBox.Items[0];
                groupBox.Items.Remove(item);
                Items.Add(item);
                i--;
            }
            IsSnapped = false;
        }
Example #12
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.buttonGreen = ((Fluent.Button)(target));
                return;

            case 2:
                this.P = ((Fluent.RibbonGroupBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #13
0
        // Handles SizeDefinitionProperty changes
        static void OnSizeDefinitionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            // Find parent group box
            RibbonGroupBox groupBox = FindParentRibbonGroupBox(d);
            UIElement      element  = (UIElement)d;

            if (groupBox != null)
            {
                SetAppropriateSize(element, groupBox.State);
            }
            else
            {
                SetAppropriateSize(element, RibbonGroupBoxState.Large);
            }
        }
Example #14
0
 private void OnQuickAccessOpened(object sender, EventArgs e)
 {
     if ((!IsDropDownOpen) && (!IsSnapped))
     {
         RibbonGroupBox groupBox = sender as RibbonGroupBox;
         // Save state
         IsSnapped = true;
         for (int i = 0; i < Items.Count; i++)
         {
             object item = Items[0];
             Items.Remove(item);
             groupBox.Items.Add(item);
             i--;
         }
     }
 }
Example #15
0
        /// <summary>
        /// Gets parent RibbonGroupBox or null
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        static RibbonGroupBox GetGroupBox(DependencyObject element)
        {
            if (element == null)
            {
                return(null);
            }
            RibbonGroupBox groupBox = element as RibbonGroupBox;

            if (groupBox != null)
            {
                return(groupBox);
            }
            DependencyObject parent = VisualTreeHelper.GetParent(element);

            return(GetGroupBox(parent));
        }
Example #16
0
        private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonGroupBox   element    = d as RibbonGroupBox;
            FrameworkElement oldElement = e.OldValue as FrameworkElement;

            if (oldElement != null)
            {
                element.RemoveLogicalChild(oldElement);
            }
            FrameworkElement newElement = e.NewValue as FrameworkElement;

            if (newElement != null)
            {
                element.AddLogicalChild(newElement);
            }
        }
Example #17
0
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            var groupBox = new RibbonGroupBox();

            RibbonControl.BindQuickAccessItem(this, groupBox);

            groupBox.DropDownOpened += this.OnQuickAccessOpened;
            groupBox.DropDownClosed += this.OnQuickAccessClosed;

            groupBox.State = RibbonGroupBoxState.QuickAccess;

            RibbonControl.Bind(this, groupBox, nameof(this.ItemTemplateSelector), ItemTemplateSelectorProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.ItemTemplate), ItemTemplateProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.ItemsSource), ItemsSourceProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommandParameter), LauncherCommandParameterProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommand), LauncherCommandProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommandTarget), LauncherCommandTargetProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherIcon), LauncherIconProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherText), LauncherTextProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherToolTip), LauncherToolTipProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.IsLauncherEnabled), IsLauncherEnabledProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.IsLauncherVisible), IsLauncherVisibleProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherKeys), DialogLauncherButtonKeyTipKeysProperty, BindingMode.OneWay);
            groupBox.LauncherClick += this.LauncherClick;

            if (this.Icon != null)
            {
                var iconVisual = this.Icon as Visual;
                if (iconVisual != null)
                {
                    var rect = new Rectangle
                    {
                        Width  = 16,
                        Height = 16,
                        Fill   = new VisualBrush(iconVisual)
                    };
                    groupBox.Icon = rect;
                }
                else
                {
                    RibbonControl.Bind(this, groupBox, nameof(this.Icon), RibbonControl.IconProperty, BindingMode.OneWay);
                }
            }

            return(groupBox);
        }
Example #18
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Default = ((Fluent.RibbonGroupBox)(target));
                return;

            case 2:
                this.Large = ((Fluent.RibbonGroupBox)(target));
                return;

            case 3:
                this.Other = ((Fluent.RibbonGroupBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        Size GetChildrenDesiredSizeIntermediate()
        {
            double width  = 0;
            double height = 0;

            foreach (UIElement child in this.InternalChildren)
            {
                RibbonGroupBox groupBox = child as RibbonGroupBox;
                if (groupBox == null)
                {
                    continue;
                }

                Size desiredSize = groupBox.DesiredSizeIntermediate;
                width += desiredSize.Width;
                height = Math.Max(height, desiredSize.Height);
            }
            return(new Size(width, height));
        }
        // Decrease size of the item
        void DecreaseGroupBoxSize(string name)
        {
            RibbonGroupBox groupBox = FindGroup(name);
            bool           scale    = name.StartsWith("(", StringComparison.OrdinalIgnoreCase);

            if (groupBox == null)
            {
                return;
            }

            if (scale)
            {
                groupBox.ScaleIntermediate--;
            }
            else
            {
                groupBox.StateIntermediate = (groupBox.StateIntermediate != RibbonGroupBoxState.Collapsed) ? groupBox.StateIntermediate + 1 : groupBox.StateIntermediate;
            }
        }
Example #21
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((Fluent.Sample.ColorGallery.Window)(target));
                return;

            case 2:
                this.A = ((Fluent.RibbonGroupBox)(target));
                return;

            case 3:
                this.colorPickerStandard = ((Fluent.DropDownButton)(target));
                return;

            case 4:
                this.colorGalleryStandard = ((Fluent.ColorGallery)(target));
                return;

            case 5:
                this.colorPickerThemed = ((Fluent.DropDownButton)(target));
                return;

            case 6:
                this.colorGalleryThemed = ((Fluent.ColorGallery)(target));
                return;

            case 7:
                this.colorPickerHighlight = ((Fluent.DropDownButton)(target));
                return;

            case 8:
                this.colorGalleryHighlight = ((Fluent.ColorGallery)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #22
0
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            RibbonGroupBox groupBox = new RibbonGroupBox();

            groupBox.DropDownOpened += OnQuickAccessOpened;
            groupBox.DropDownClosed += OnQuickAccessClosed;
            groupBox.State           = RibbonGroupBoxState.QuickAccess;


            //RibbonControl.BindQuickAccessItem(this, groupBox);
            //if (QuickAccessElementStyle != null) RibbonControl.Bind(this, groupBox, "QuickAccessElementStyle", StyleProperty, BindingMode.OneWay);
            //RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);

            if (Icon != null)
            {
                Visual iconVisual = Icon as Visual;
                if (iconVisual != null)
                {
                    Rectangle rect = new Rectangle();
                    rect.Width    = 16;
                    rect.Height   = 16;
                    rect.Fill     = new VisualBrush(iconVisual);
                    groupBox.Icon = rect;
                }
                else
                {
                    RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);
                }
            }
            if (Header != null)
            {
                RibbonControl.Bind(this, groupBox, "Header", RibbonControl.HeaderProperty, BindingMode.OneWay);
            }

            return(groupBox);
        }
Example #23
0
        // Find key tips on the given element
        private void FindKeyTips(UIElement element, bool hide)
        {
            this.Log("FindKeyTips");

            IEnumerable children = LogicalTreeHelper.GetChildren(element);

            foreach (object item in children)
            {
                UIElement      child    = item as UIElement;
                RibbonGroupBox groupBox = (child as RibbonGroupBox);
                if (child != null)
                {
                    string keys = KeyTip.GetKeys(child);
                    if (keys != null)
                    {
                        // Gotcha!
                        KeyTip keyTip = new KeyTip
                        {
                            Content    = keys,
                            Visibility = hide
                                                ? Visibility.Collapsed
                                                : Visibility.Visible
                        };

                        // Add to list & visual
                        // children collections
                        keyTips.Add(keyTip);
                        base.AddVisualChild(keyTip);
                        associatedElements.Add(child);

                        if (groupBox != null)
                        {
                            if (groupBox.State == RibbonGroupBoxState.Collapsed)
                            {
                                keyTip.Visibility = Visibility.Visible;
                                FindKeyTips(child, true);
                                continue;
                            }
                            else
                            {
                                keyTip.Visibility = Visibility.Collapsed;
                            }
                        }
                        else
                        {
                            // Bind IsEnabled property
                            Binding binding = new Binding("IsEnabled")
                            {
                                Source = child,
                                Mode   = BindingMode.OneWay
                            };
                            keyTip.SetBinding(UIElement.IsEnabledProperty, binding);
                            continue;
                        }
                    }

                    if ((groupBox != null) &&
                        (groupBox.State == RibbonGroupBoxState.Collapsed))
                    {
                        FindKeyTips(child, true);
                    }
                    else
                    {
                        FindKeyTips(child, hide);
                    }
                }
            }
        }
Example #24
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.fmMain = ((LEDX.MWin)(target));
     return;
     case 2:
     this.ribbon = ((Fluent.Ribbon)(target));
     
     #line 57 "..\..\MainWindow.xaml"
     this.ribbon.SelectedTabChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Ribbon_SelectedTabChanged);
     
     #line default
     #line hidden
     return;
     case 3:
     this.btNewProj = ((Fluent.Button)(target));
     return;
     case 4:
     this.btOpenProj = ((Fluent.Button)(target));
     return;
     case 5:
     this.btSaveProj = ((Fluent.Button)(target));
     return;
     case 6:
     this.tbEdit = ((Fluent.RibbonTabItem)(target));
     return;
     case 7:
     this.btUndo = ((Fluent.SplitButton)(target));
     return;
     case 8:
     this.btPasteFram = ((Fluent.SplitButton)(target));
     return;
     case 9:
     this.rgbContrProp = ((Fluent.RibbonGroupBox)(target));
     return;
     case 10:
     this.spAddNew = ((Fluent.SplitButton)(target));
     return;
     case 11:
     this.btDel = ((Fluent.MenuItem)(target));
     return;
     case 12:
     this.tbConName = ((Fluent.TextBox)(target));
     return;
     case 13:
     this.tbConNumb = ((Fluent.Spinner)(target));
     return;
     case 14:
     this.tbConButt = ((Fluent.Spinner)(target));
     return;
     case 15:
     this.rgbFrameProp = ((Fluent.RibbonGroupBox)(target));
     return;
     case 16:
     this.spTime = ((Fluent.Spinner)(target));
     return;
     case 17:
     this.btCopyFram = ((Fluent.Button)(target));
     return;
     case 18:
     this.btCutFram = ((Fluent.Button)(target));
     return;
     case 19:
     this.btDelFram = ((Fluent.Button)(target));
     return;
     case 20:
     this.btToSample = ((Fluent.Button)(target));
     return;
     case 21:
     this.spbtFSet = ((Fluent.SplitButton)(target));
     
     #line 179 "..\..\MainWindow.xaml"
     this.spbtFSet.DropDownClosed += new System.EventHandler(this.SpbtFSet_DropDownClosed);
     
     #line default
     #line hidden
     return;
     case 22:
     this.rgbColorProp = ((Fluent.RibbonGroupBox)(target));
     return;
     case 23:
     this.btBegColor = ((Fluent.Button)(target));
     return;
     case 24:
     this.rctBegClolor = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 25:
     this.btCopyColor = ((Fluent.Button)(target));
     return;
     case 26:
     this.btGetColor = ((Fluent.Button)(target));
     return;
     case 27:
     this.btEndColor = ((Fluent.Button)(target));
     return;
     case 28:
     this.rctEndClolor = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 29:
     this.btCopy = ((Fluent.Button)(target));
     return;
     case 30:
     this.grSampl = ((Fluent.InRibbonGallery)(target));
     return;
     case 31:
     this.tbPalyer = ((Fluent.RibbonTabItem)(target));
     return;
     case 32:
     this.rgbPropLayer = ((Fluent.RibbonGroupBox)(target));
     return;
     case 33:
     this.btLayerDown = ((Fluent.Button)(target));
     return;
     case 34:
     this.btLayerTop = ((Fluent.Button)(target));
     return;
     case 35:
     this.btDelLay = ((Fluent.Button)(target));
     return;
     case 36:
     this.rgbPropPng = ((Fluent.RibbonGroupBox)(target));
     return;
     case 37:
     this.cbController = ((Fluent.ComboBox)(target));
     return;
     case 38:
     this.lgWidth = ((Fluent.TextBox)(target));
     return;
     case 39:
     this.lgHeight = ((Fluent.TextBox)(target));
     return;
     case 40:
     this.rgbPropText = ((Fluent.RibbonGroupBox)(target));
     return;
     case 41:
     this.lbtemTest = ((System.Windows.Controls.Label)(target));
     return;
     case 42:
     this.temTest = ((LEDX.Components.MultiLineTextEditor)(target));
     return;
     case 43:
     this.spTextSize = ((Fluent.Spinner)(target));
     return;
     case 44:
     this.cbFontFamaly = ((Fluent.ComboBox)(target));
     return;
     case 45:
     this.rctTextClolor = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 46:
     this.tbFlash = ((Fluent.RibbonTabItem)(target));
     return;
     case 47:
     this.lbPort = ((System.Windows.Controls.Label)(target));
     return;
     case 48:
     this.cbComName = ((Fluent.ComboBox)(target));
     return;
     case 49:
     this.lbSpeed = ((System.Windows.Controls.Label)(target));
     return;
     case 50:
     this.cbComRate = ((Fluent.ComboBox)(target));
     return;
     case 51:
     this.btRefrPorts = ((Fluent.Button)(target));
     return;
     case 52:
     this.tbSync = ((Fluent.ToggleButton)(target));
     return;
     case 53:
     this.tgbShowLog = ((Fluent.ToggleButton)(target));
     return;
     case 54:
     this.spProgress = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 55:
     this.uiScaleSlider = ((System.Windows.Controls.Slider)(target));
     
     #line 531 "..\..\MainWindow.xaml"
     this.uiScaleSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler<double>(this.uiScaleSlider_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 56:
     this.uiMan = ((LEDX.Components.PlayScale)(target));
     return;
     case 57:
     this.svSearch = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 58:
     this.sldTime = ((LEDX.Components.TimeSlider)(target));
     
     #line 561 "..\..\MainWindow.xaml"
     this.sldTime.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler<double>(this.sld_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 59:
     this.scroll = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 60:
     this.icContr = ((System.Windows.Controls.ItemsControl)(target));
     return;
     case 61:
     this.svTracks = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 62:
     this.icTrack = ((System.Windows.Controls.ItemsControl)(target));
     return;
     case 63:
     this.iCanv = ((LEDX.Components.IncRender)(target));
     
     #line 598 "..\..\MainWindow.xaml"
     this.iCanv.SelectionChanged += new System.EventHandler(this.iCanv_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 64:
     this.mainScroller = ((System.Windows.Controls.ScrollViewer)(target));
     
     #line 607 "..\..\MainWindow.xaml"
     this.mainScroller.ScrollChanged += new System.Windows.Controls.ScrollChangedEventHandler(this.mainScroller_ScrollChanged);
     
     #line default
     #line hidden
     return;
     case 65:
     this.svLog = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 66:
     this.tbLog = ((System.Windows.Controls.TextBox)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #25
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.groupL = ((Fluent.RibbonGroupBox)(target));
                return;

            case 2:
                this.select = ((Fluent.Button)(target));

            #line 52 "..\..\MainWindow.xaml"
                this.select.Click += new System.Windows.RoutedEventHandler(this.SelectButton_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.cobFF = ((Fluent.ComboBox)(target));
                return;

            case 4:
                this.cobFS = ((Fluent.ComboBox)(target));
                return;

            case 5:
                this.cobFC = ((Fluent.ComboBox)(target));
                return;

            case 6:
                this.colorGallery = ((Fluent.ColorGallery)(target));

            #line 75 "..\..\MainWindow.xaml"
                this.colorGallery.SelectedColorChanged += new System.Windows.RoutedEventHandler(this.ColorGallery_SelectedColorChanged);

            #line default
            #line hidden
                return;

            case 7:

            #line 92 "..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.EraserButton_Click);

            #line default
            #line hidden
                return;

            case 8:

            #line 93 "..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ArrowButton_Click);

            #line default
            #line hidden
                return;

            case 9:

            #line 94 "..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.PenButton_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.Tools = ((Fluent.RibbonGroupBox)(target));
                return;

            case 11:
                this.toolsGallery = ((Fluent.InRibbonGallery)(target));

            #line 123 "..\..\MainWindow.xaml"
                this.toolsGallery.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.InRibbonGallery_SelectionChanged);

            #line default
            #line hidden
                return;

            case 12:
                this.gro = ((Fluent.RibbonGroupBox)(target));
                return;

            case 13:
                this.IsCheckBox14 = ((Fluent.CheckBox)(target));
                return;

            case 14:
                this.IsCheckBox15 = ((Fluent.CheckBox)(target));
                return;

            case 15:
                this.IsCheckBox16 = ((Fluent.CheckBox)(target));
                return;

            case 16:
                this.canvas = ((System.Windows.Controls.InkCanvas)(target));

            #line 174 "..\..\MainWindow.xaml"
                this.canvas.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.ink_MouseWheel);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private void AddRibbonTab_OnClick(object sender, RoutedEventArgs e)
        {
            var tab = new RibbonTabItem
            {
                Header = "Test"
            };

            var group = new RibbonGroupBox();
            for (var i = 0; i < 20; i++)
            {
                group.Items.Add(this.CreateRibbonButton());
            }

            tab.Groups.Add(group);

            this.ribbon.Tabs.Add(tab);
        }
Example #27
0
        private void GenerateAndAddGroupBoxKeyTipInformation(bool hide, string keys, FrameworkElement child, RibbonGroupBox groupBox)
        {
            var keyTipInformation = new KeyTipInformation(keys, child, hide || groupBox.State != RibbonGroupBoxState.Collapsed);

            // Add to list & visual children collections
            this.AddKeyTipInformationElement(keyTipInformation);

            this.LogDebug("Found KeyTipped RibbonGroupBox \"{0}\" with keys \"{1}\".", keyTipInformation.AssociatedElement, keyTipInformation.Keys);
        }
Example #28
0
        void UpdateKeyTipPositions()
        {
            if (keyTips.Count == 0)
            {
                return;
            }

            double[]       rows     = null;
            RibbonGroupBox groupBox = GetGroupBox(oneOfAssociatedElements);

            if (groupBox != null)
            {
                Panel panel = groupBox.GetPanel();
                if (panel != null)
                {
                    double height = groupBox.GetLayoutRoot().DesiredSize.Height;
                    rows = new double[]
                    {
                        groupBox.GetLayoutRoot().TranslatePoint(new Point(0, 0), AdornedElement).Y,
                        groupBox.GetLayoutRoot().TranslatePoint(new Point(0, panel.DesiredSize.Height / 2.0), AdornedElement).Y,
                        groupBox.GetLayoutRoot().TranslatePoint(new Point(0, panel.DesiredSize.Height), AdornedElement).Y,
                        groupBox.GetLayoutRoot().TranslatePoint(new Point(0, height + 1), AdornedElement).Y
                    };
                }
            }

            for (int i = 0; i < keyTips.Count; i++)
            {
                // Skip invisible keytips
                if (keyTips[i].Visibility != Visibility.Visible)
                {
                    continue;
                }

                // Update KeyTip Visibility
                bool associatedElementIsVisible    = associatedElements[i].Visibility == Visibility.Visible;
                bool associatedElementInVisualTree = VisualTreeHelper.GetParent(associatedElements[i]) != null;
                keyTips[i].Visibility = associatedElementIsVisible && associatedElementInVisualTree ? Visibility.Visible : Visibility.Collapsed;

                if (!KeyTip.GetAutoPlacement(associatedElements[i]))
                {
                    #region Custom Placement

                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].RenderSize;

                    double    x = 0, y = 0;
                    Thickness margin = KeyTip.GetMargin(associatedElements[i]);
                    switch (KeyTip.GetHorizontalAlignment(associatedElements[i]))
                    {
                    case HorizontalAlignment.Left:
                        x = margin.Left;
                        break;

                    case HorizontalAlignment.Right:
                        x = elementSize.Width - keyTipSize.Width - margin.Right;
                        break;

                    case HorizontalAlignment.Center:
                    case HorizontalAlignment.Stretch:
                        x = elementSize.Width / 2.0 - keyTipSize.Width / 2.0 + margin.Left;
                        break;
                    }
                    switch (KeyTip.GetVerticalAlignment(associatedElements[i]))
                    {
                    case VerticalAlignment.Top:
                        y = margin.Top;
                        break;

                    case VerticalAlignment.Bottom:
                        y = elementSize.Height - keyTipSize.Height - margin.Bottom;
                        break;

                    case VerticalAlignment.Center:
                    case VerticalAlignment.Stretch:
                        y = elementSize.Height / 2.0 - keyTipSize.Height / 2.0 + margin.Top;
                        break;
                    }
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(new Point(x, y), AdornedElement);

                    #endregion
                }
                else if (((FrameworkElement)associatedElements[i]).Name == "PART_DialogLauncherButton")
                {
                    // Dialog Launcher Button Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].RenderSize;
                    if (rows == null)
                    {
                        continue;
                    }

                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(elementSize.Width / 2.0 - keyTipSize.Width / 2.0,
                                  0), AdornedElement);
                    keyTipPositions[i].Y = rows[3];
                }
                else if ((associatedElements[i] is InRibbonGallery && !((InRibbonGallery)associatedElements[i]).IsCollapsed))
                {
                    // InRibbonGallery Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].RenderSize;
                    if (rows == null)
                    {
                        continue;
                    }

                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(elementSize.Width - keyTipSize.Width / 2.0,
                                  0), AdornedElement);
                    keyTipPositions[i].Y = rows[2] - keyTipSize.Height / 2;
                }
                else if ((associatedElements[i] is RibbonTabItem) || (associatedElements[i] is BackstageButton))
                {
                    // Ribbon Tab Item Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].RenderSize;
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(elementSize.Width / 2.0 - keyTipSize.Width / 2.0,
                                  elementSize.Height - keyTipSize.Height / 2.0), AdornedElement);
                }
                else if (associatedElements[i] is RibbonGroupBox)
                {
                    // Ribbon Group Box Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].DesiredSize;
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(elementSize.Width / 2.0 - keyTipSize.Width / 2.0,
                                  elementSize.Height + 1), AdornedElement);
                }
                else if (IsWithinQuickAccessToolbar(associatedElements[i]))
                {
                    Point translatedPoint = associatedElements[i].TranslatePoint(new Point(
                                                                                     associatedElements[i].DesiredSize.Width / 2.0 - keyTips[i].DesiredSize.Width / 2.0,
                                                                                     associatedElements[i].DesiredSize.Height - keyTips[i].DesiredSize.Height / 2.0), AdornedElement);
                    keyTipPositions[i] = translatedPoint;
                }
                else if (associatedElements[i] is MenuItem)
                {
                    // MenuItem Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].DesiredSize;
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(
                            elementSize.Height / 2.0 + 2,
                            elementSize.Height / 2.0 + 2), AdornedElement);
                }
                else if (associatedElements[i] is BackstageTabItem)
                {
                    // BackstageButton Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].DesiredSize;
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(
                            5,
                            elementSize.Height / 2.0 - keyTipSize.Height), AdornedElement);
                }
                else if (((FrameworkElement)associatedElements[i]).Parent is Backstage)
                {
                    // Backstage Items Exclusive Placement
                    Size keyTipSize  = keyTips[i].DesiredSize;
                    Size elementSize = associatedElements[i].DesiredSize;
                    keyTipPositions[i] = associatedElements[i].TranslatePoint(
                        new Point(
                            20,
                            elementSize.Height / 2.0 - keyTipSize.Height), AdornedElement);
                }
                else
                {
                    if (((associatedElements[i] is RibbonControl) && (((RibbonControl)associatedElements[i]).Size != RibbonControlSize.Large)) ||
                        (associatedElements[i] is Spinner) || (associatedElements[i] is ComboBox) || (associatedElements[i] is TextBox))
                    {
                        bool  withinRibbonToolbar = IsWithinRibbonToolbarInTwoLine(associatedElements[i]);
                        Point translatedPoint     = associatedElements[i].TranslatePoint(new Point(keyTips[i].DesiredSize.Width / 2.0, keyTips[i].DesiredSize.Height / 2.0), AdornedElement);
                        // Snapping to rows if it present
                        if (rows != null)
                        {
                            int    index       = 0;
                            double mindistance = Math.Abs(rows[0] - translatedPoint.Y);
                            for (int j = 1; j < rows.Length; j++)
                            {
                                if (withinRibbonToolbar && j == 1)
                                {
                                    continue;
                                }
                                double distance = Math.Abs(rows[j] - translatedPoint.Y);
                                if (distance < mindistance)
                                {
                                    mindistance = distance;
                                    index       = j;
                                }
                            }
                            translatedPoint.Y = rows[index] - keyTips[i].DesiredSize.Height / 2.0;
                        }
                        keyTipPositions[i] = translatedPoint;
                    }
                    else
                    {
                        Point translatedPoint = associatedElements[i].TranslatePoint(new Point(
                                                                                         associatedElements[i].DesiredSize.Width / 2.0 - keyTips[i].DesiredSize.Width / 2.0,
                                                                                         associatedElements[i].DesiredSize.Height - 8), AdornedElement);
                        if (rows != null)
                        {
                            translatedPoint.Y = rows[2] - keyTips[i].DesiredSize.Height / 2.0;
                        }
                        keyTipPositions[i] = translatedPoint;
                    }
                }
            }
        }
Example #29
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ribbon = ((Fluent.Ribbon)(target));
                return;

            case 2:
                this.homeTabItem = ((Fluent.RibbonTabItem)(target));
                return;

            case 3:
                this.themesGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

            case 4:
                this.silverThemeBtn = ((Fluent.Button)(target));

            #line 60 "..\..\MainWindowContent.xaml"
                this.silverThemeBtn.Click += new System.Windows.RoutedEventHandler(this.silverThemeBtn_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.blackThemeBtn = ((Fluent.Button)(target));

            #line 63 "..\..\MainWindowContent.xaml"
                this.blackThemeBtn.Click += new System.Windows.RoutedEventHandler(this.blackThemeBtn_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.blueThemeBtn = ((Fluent.Button)(target));

            #line 66 "..\..\MainWindowContent.xaml"
                this.blueThemeBtn.Click += new System.Windows.RoutedEventHandler(this.blueThemeBtn_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.DontUseDwm = ((Fluent.CheckBox)(target));

            #line 67 "..\..\MainWindowContent.xaml"
                this.DontUseDwm.Click += new System.Windows.RoutedEventHandler(this.DontUseDwm_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.memoryGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

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

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

            case 11:
                this.ViewTabItem = ((Fluent.RibbonTabItem)(target));
                return;

            case 12:
                this.displayRangeGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

            case 13:
                this.imageGallery = ((Hywire.ImageProcessing.ImageDisplayer.View.ImageGallery)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #30
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TestContentControl = ((FluentTest.TestContent)(target));
                return;

            case 3:
                this.ribbon = ((Fluent.Ribbon)(target));
                return;

            case 4:
                this.tabGroup1 = ((Fluent.RibbonContextualTabGroup)(target));
                return;

            case 5:
                this.tabGroup2 = ((Fluent.RibbonContextualTabGroup)(target));
                return;

            case 6:
                this.invisibleTabGroup = ((Fluent.RibbonContextualTabGroup)(target));
                return;

            case 7:
                this.startScreen = ((Fluent.StartScreen)(target));
                return;

            case 8:

            #line 155 "TestContent.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.HandleSaveAsClick);

            #line default
            #line hidden
                return;

            case 9:

            #line 255 "TestContent.xaml"
                ((Fluent.Spinner)(target)).ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.OnSpinnerValueChanged);

            #line default
            #line hidden
                return;

            case 10:

            #line 284 "TestContent.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OnHelpClick);

            #line default
            #line hidden
                return;

            case 11:
                this.Clipboard = ((Fluent.RibbonGroupBox)(target));

            #line 328 "TestContent.xaml"
                this.Clipboard.LauncherClick += new System.Windows.RoutedEventHandler(this.OnLauncherButtonClick);

            #line default
            #line hidden
                return;

            case 12:
                this.saveButton = ((Fluent.Button)(target));

            #line 337 "TestContent.xaml"
                this.saveButton.Click += new System.Windows.RoutedEventHandler(this.OnSaveButtonClick);

            #line default
            #line hidden
                return;

            case 13:
                this.buttonWatermark = ((Fluent.DropDownButton)(target));
                return;

            case 14:
                this.WatermarkGallery = ((Fluent.Gallery)(target));
                return;

            case 15:

            #line 360 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Suit_Button_Click);

            #line default
            #line hidden
                return;

            case 16:

            #line 374 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Sequence_Button_Click);

            #line default
            #line hidden
                return;

            case 17:

            #line 389 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Step_Button_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.addChildren = ((Fluent.DropDownButton)(target));
                return;

            case 19:
                this.ChildrenGallery = ((Fluent.Gallery)(target));
                return;

            case 20:

            #line 422 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_App_Button_Click);

            #line default
            #line hidden
                return;

            case 21:

            #line 434 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_DataSource_Button_Click);

            #line default
            #line hidden
                return;

            case 22:

            #line 447 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Variable_Button_Click);

            #line default
            #line hidden
                return;

            case 23:

            #line 460 "TestContent.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Variable_Button_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.cutButton = ((Fluent.Button)(target));
                return;

            case 25:
                this.copyButton = ((Fluent.Button)(target));
                return;

            case 26:
                this.pasteButton = ((Fluent.Button)(target));

            #line 508 "TestContent.xaml"
                this.pasteButton.Click += new System.Windows.RoutedEventHandler(this.OnFormatPainterClick);

            #line default
            #line hidden
                return;

            case 27:
                this.FunctionsGalleryGroup = ((Fluent.RibbonGroupBox)(target));
                return;

            case 28:
                this.galleryFunctionsInRibbonGallery = ((Fluent.InRibbonGallery)(target));
                return;

            case 29:
                this.functionsFilterAll = ((Fluent.GalleryGroupFilter)(target));
                return;

            case 30:
                this.Font = ((Fluent.RibbonGroupBox)(target));

            #line 537 "TestContent.xaml"
                this.Font.LauncherClick += new System.Windows.RoutedEventHandler(this.OnLauncherButtonClick);

            #line default
            #line hidden
                return;

            case 31:
                this.comboBoxFontName = ((Fluent.ComboBox)(target));
                return;

            case 32:
                this.segoeFont = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 33:
                this.comboBoxFontSize = ((Fluent.ComboBox)(target));
                return;

            case 34:
                this.buttonGrowFont = ((Fluent.Button)(target));
                return;

            case 35:
                this.buttonShrinkFont = ((Fluent.Button)(target));
                return;

            case 36:
                this.buttonChangeCase = ((Fluent.DropDownButton)(target));
                return;

            case 37:
                this.buttonClearFormatting = ((Fluent.Button)(target));
                return;

            case 38:
                this.buttonBold = ((Fluent.ToggleButton)(target));
                return;

            case 39:
                this.buttonItalic = ((Fluent.ToggleButton)(target));
                return;

            case 40:
                this.buttonUnderline = ((Fluent.DropDownButton)(target));
                return;

            case 41:
                this.buttonStrikethrough = ((Fluent.Button)(target));
                return;

            case 42:
                this.buttonSubscript = ((Fluent.Button)(target));
                return;

            case 43:
                this.buttonSuperscript = ((Fluent.Button)(target));
                return;

            case 44:
                this.buttonTextEffects = ((Fluent.DropDownButton)(target));
                return;

            case 45:
                this.buttonTextHighlightColor = ((Fluent.DropDownButton)(target));
                return;

            case 46:
                this.buttonFontColor = ((Fluent.DropDownButton)(target));
                return;

            case 47:
                this.Group = ((Fluent.RibbonGroupBox)(target));
                return;

            case 48:
                this.spinner = ((Fluent.Spinner)(target));
                return;

            case 49:
                this.buttonGreen = ((Fluent.Button)(target));
                return;

            case 50:
                this.buttonGray = ((Fluent.Button)(target));
                return;

            case 51:
                this.buttonYellow = ((Fluent.Button)(target));
                return;

            case 52:
                this.buttonBrown = ((Fluent.Button)(target));
                return;

            case 53:
                this.B = ((Fluent.RibbonGroupBox)(target));

            #line 889 "TestContent.xaml"
                this.B.LauncherClick += new System.Windows.RoutedEventHandler(this.OnLauncherButtonClick);

            #line default
            #line hidden
                return;

            case 54:
                this.groupLL = ((Fluent.RibbonGroupBox)(target));
                return;

            case 55:

            #line 951 "TestContent.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.HandleAddItemToFontsClick);

            #line default
            #line hidden
                return;

            case 56:
                this.InRibbonGallery = ((Fluent.InRibbonGallery)(target));
                return;

            case 57:

            #line 1383 "TestContent.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OnEnlargeClick);

            #line default
            #line hidden
                return;

            case 58:

            #line 1388 "TestContent.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OnReduceClick);

            #line default
            #line hidden
                return;

            case 59:
                this.UndoButton = ((Fluent.SplitButton)(target));
                return;

            case 60:
                this.ShowDetailButton = ((Fluent.ToggleButton)(target));
                return;

            case 61:
                this.ShowMoreButton = ((Fluent.ToggleButton)(target));
                return;

            case 62:
                this.FirstGalleryGroup = ((Fluent.RibbonGroupBox)(target));
                return;

            case 63:
                this.dropDownGreen = ((Fluent.DropDownButton)(target));
                return;

            case 64:
                this.SecondGalleryGroup = ((Fluent.RibbonGroupBox)(target));
                return;

            case 65:
                this.gallerySampleInRibbonGallery = ((Fluent.InRibbonGallery)(target));
                return;

            case 66:
                this.galleryFilterAll = ((Fluent.GalleryGroupFilter)(target));
                return;

            case 67:
                this.A = ((Fluent.RibbonGroupBox)(target));

            #line 1798 "TestContent.xaml"
                this.A.LauncherClick += new System.Windows.RoutedEventHandler(this.OnLauncherButtonClick);

            #line default
            #line hidden
                return;

            case 68:
                this.GalleryFilterAll = ((Fluent.GalleryGroupFilter)(target));
                return;

            case 69:

            #line 1850 "TestContent.xaml"
                ((Fluent.SplitButton)(target)).Click += new System.Windows.RoutedEventHandler(this.OnSplitClick);

            #line default
            #line hidden
                return;

            case 70:
                this.Default = ((Fluent.RibbonGroupBox)(target));
                return;

            case 71:
                this.Large = ((Fluent.RibbonGroupBox)(target));
                return;

            case 72:
                this.Other = ((Fluent.RibbonGroupBox)(target));
                return;

            case 73:
                this.ZC = ((Fluent.RibbonGroupBox)(target));
                return;

            case 74:
                this.xxx = ((Fluent.RibbonGroupBox)(target));

            #line 2317 "TestContent.xaml"
                this.xxx.LauncherClick += new System.Windows.RoutedEventHandler(this.OnLauncherButtonClick);

            #line default
            #line hidden
                return;

            case 75:
                this.zoomSlider = ((System.Windows.Controls.Slider)(target));

            #line 2628 "TestContent.xaml"
                this.zoomSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ZoomSlider_OnValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        /// <summary>
        /// Measures all of the RibbonGroupBox, and resize them appropriately
        /// to fit within the available room
        /// </summary>
        /// <param name="availableSize">The available size that this element can give to child elements.</param>
        /// <returns>The size that the groups container determines it needs during
        /// layout, based on its calculations of child element sizes.
        /// </returns>
        protected override Size MeasureOverride(Size availableSize)
        {
            Size infinitySize = new Size(Double.PositiveInfinity, availableSize.Height);
            Size desiredSize  = GetChildrenDesiredSizeIntermediate();

            if (reduceOrder.Length == 0)
            {
                VerifyScrollData(availableSize.Width, desiredSize.Width);
                return(desiredSize);
            }

            // If we have more available space - try to expand groups
            while (desiredSize.Width <= availableSize.Width)
            {
                bool hasMoreVariants = reduceOrderIndex < reduceOrder.Length - 1;
                if (!hasMoreVariants)
                {
                    break;
                }

                // Increase size of another item
                reduceOrderIndex++;
                IncreaseGroupBoxSize(reduceOrder[reduceOrderIndex]);

                desiredSize = GetChildrenDesiredSizeIntermediate();
            }

            // If not enough space - go to next variant
            while (desiredSize.Width > availableSize.Width)
            {
                bool hasMoreVariants = reduceOrderIndex >= 0;
                if (!hasMoreVariants)
                {
                    break;
                }

                // Decrease size of another item
                DecreaseGroupBoxSize(reduceOrder[reduceOrderIndex]);
                reduceOrderIndex--;

                desiredSize = GetChildrenDesiredSizeIntermediate();
            }

            // Set find values
            foreach (object item in InternalChildren)
            {
                RibbonGroupBox groupBox = item as RibbonGroupBox;
                if (groupBox == null)
                {
                    continue;
                }

                if ((groupBox.State != groupBox.StateIntermediate) ||
                    (groupBox.Scale != groupBox.ScaleIntermediate))
                {
                    groupBox.SuppressCacheReseting = true;
                    groupBox.State = groupBox.StateIntermediate;
                    groupBox.Scale = groupBox.ScaleIntermediate;
                    groupBox.InvalidateLayout();
                    groupBox.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                    groupBox.SuppressCacheReseting = false;
                }

                // Something wrong with cache?
                if (groupBox.DesiredSizeIntermediate != groupBox.DesiredSize)
                {
                    // Reset cache and reinvoke masure
                    groupBox.ClearCache();
                    return(MeasureOverride(availableSize));
                }
            }

            VerifyScrollData(availableSize.Width, desiredSize.Width);
            return(desiredSize);
        }
        /// <summary>
        /// Create ribbon menus.
        /// </summary>
        /// <param name="ribbonMenu"></param>
        public override void CreateRibbonMenu(Ribbon ribbonMenu)
        {
            base.CreateRibbonMenu(ribbonMenu);

            // in case the tab group is used for multiple vms, prevent multiple tabs beeing created
            foreach (Fluent.RibbonContextualTabGroup t in ribbonMenu.ContextualGroups)
                if (t.Name == "tabGroupExamplePlugin")
                {
                    exampleTabGroup = t;
                    return;
                }

            // contextual tab, which should only be visible when the example diagram surface is active
            exampleTabGroup = new RibbonContextualTabGroup();
            exampleTabGroup.Header = "Example Tab Group";
            exampleTabGroup.BorderBrush = new SolidColorBrush(System.Windows.Media.Colors.LightBlue);
            exampleTabGroup.Background = new SolidColorBrush(System.Windows.Media.Colors.LightBlue);
            exampleTabGroup.Name = "tabGroupExamplePlugin";

            // create ribbon bar and associate it with the contextual group
            RibbonTabItem exampleTab = new RibbonTabItem();
            exampleTab.Header = "Example View Operations";
            exampleTab.Group = exampleTabGroup;

            // Analyze group
            RibbonGroupBox analyzeGroup = new RibbonGroupBox();
            analyzeGroup.Header = "Analyze";
            exampleTab.Groups.Add(analyzeGroup);

            Fluent.Button buttonAnalyze = new Fluent.Button();
            buttonAnalyze.Text = "Analyze";
            buttonAnalyze.Command = this.command;
            buttonAnalyze.Size = RibbonControlSize.Large;
            buttonAnalyze.LargeIcon = GetImage("prepare_32.png");
            analyzeGroup.Items.Add(buttonAnalyze);

            // View group
            RibbonGroupBox viewGroup = new RibbonGroupBox();
            viewGroup.Header = "View";
            exampleTab.Groups.Add(viewGroup);

            Fluent.ToggleButton buttonTree = new Fluent.ToggleButton();
            buttonTree.Text = "Tree";
            buttonTree.LargeIcon = GetImage("tree-32.png");
            viewGroup.Items.Add(buttonTree);

            Fluent.ToggleButton buttonTable = new Fluent.ToggleButton();
            buttonTable.Text = "Table";
            buttonTable.LargeIcon = GetImage("table-32.png");
            viewGroup.Items.Add(buttonTable);

            // Export group
            RibbonGroupBox exportGroup = new RibbonGroupBox();
            exportGroup.Header = "Export";
            exampleTab.Groups.Add(exportGroup);

            Fluent.Button buttonExportCSV = new Fluent.Button();
            buttonExportCSV.Text = "Export as CSV-File";
            buttonExportCSV.Size = RibbonControlSize.Large;
            buttonExportCSV.LargeIcon = GetImage("csv_32x32.png");
            buttonExportCSV.Command = this.command;
            exportGroup.Items.Add(buttonExportCSV);

            Fluent.Button buttonExportHTML = new Fluent.Button();
            buttonExportHTML.Text = "Export as HTML Website";
            buttonExportHTML.Size = RibbonControlSize.Large;
            buttonExportHTML.LargeIcon = GetImage("html_32x32.png");
            buttonExportHTML.Command = this.command;
            exportGroup.Items.Add(buttonExportHTML);

            Fluent.Button buttonExportPDF = new Fluent.Button();
            buttonExportPDF.Text = "Export as PDF Document";
            buttonExportPDF.Size = RibbonControlSize.Large;
            buttonExportPDF.LargeIcon = GetImage("pdf_32x32.png");
            buttonExportPDF.Command = this.command;
            exportGroup.Items.Add(buttonExportPDF);

            ribbonMenu.ContextualGroups.Add(exampleTabGroup);
            ribbonMenu.Tabs.Add(exampleTab);
        }
Example #33
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;
 }
Example #34
0
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original 
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            RibbonGroupBox groupBox = new RibbonGroupBox();

            groupBox.DropDownOpened += OnQuickAccessOpened;
            groupBox.DropDownClosed += OnQuickAccessClosed;
            groupBox.State = RibbonGroupBoxState.QuickAccess;


            //RibbonControl.BindQuickAccessItem(this, groupBox);
            //if (QuickAccessElementStyle != null) RibbonControl.Bind(this, groupBox, "QuickAccessElementStyle", StyleProperty, BindingMode.OneWay);
            //RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);

            if (Icon != null)
            {
                Visual iconVisual = Icon as Visual;
                if (iconVisual != null)
                {
                    Rectangle rect = new Rectangle();
                    rect.Width = 16;
                    rect.Height = 16;
                    rect.Fill = new VisualBrush(iconVisual);
                    groupBox.Icon = rect;
                }
                else RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);
            }
            if (Header != null) RibbonControl.Bind(this, groupBox, "Header", RibbonControl.HeaderProperty, BindingMode.OneWay);

            return groupBox;
        }
Example #35
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\MainWindow.xaml"
                ((jg.Editor.MainWindow)(target)).KeyUp += new System.Windows.Input.KeyEventHandler(this.RibbonWindow_KeyUp);

            #line default
            #line hidden

            #line 12 "..\..\..\MainWindow.xaml"
                ((jg.Editor.MainWindow)(target)).PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(this.RibbonWindow_PreviewMouseDown);

            #line default
            #line hidden

            #line 14 "..\..\..\MainWindow.xaml"
                ((jg.Editor.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 15 "..\..\..\MainWindow.xaml"
                ((jg.Editor.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden

            #line 18 "..\..\..\MainWindow.xaml"
                ((jg.Editor.MainWindow)(target)).Deactivated += new System.EventHandler(this.RibbonWindow_Deactivated);

            #line default
            #line hidden
                return;

            case 12:

            #line 325 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 325 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 13:

            #line 326 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 326 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 14:

            #line 327 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 327 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 15:

            #line 328 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 328 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 16:

            #line 329 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 329 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 17:

            #line 330 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 330 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 18:

            #line 331 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 331 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 19:

            #line 332 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_CanExecute);

            #line default
            #line hidden

            #line 332 "..\..\..\MainWindow.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed);

            #line default
            #line hidden
                return;

            case 20:
                this.col1 = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 21:
                this.col5 = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 22:
                this.rowStage = ((System.Windows.Controls.RowDefinition)(target));
                return;

            case 23:
                this.row4 = ((System.Windows.Controls.RowDefinition)(target));
                return;

            case 24:
                this.ribbon = ((Fluent.Ribbon)(target));
                return;

            case 25:
                this.btnCreate = ((Fluent.Button)(target));

            #line 377 "..\..\..\MainWindow.xaml"
                this.btnCreate.Click += new System.Windows.RoutedEventHandler(this.btnCreate_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.btnLoad = ((Fluent.Button)(target));

            #line 380 "..\..\..\MainWindow.xaml"
                this.btnLoad.Click += new System.Windows.RoutedEventHandler(this.btnLoad_Click);

            #line default
            #line hidden
                return;

            case 27:

            #line 383 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_8);

            #line default
            #line hidden
                return;

            case 28:

            #line 387 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_7);

            #line default
            #line hidden
                return;

            case 29:

            #line 421 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnAddKey_Click);

            #line default
            #line hidden
                return;

            case 30:
                this.FileName = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 31:
                this.UpdateTime = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 32:
                this.CreateTime = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 33:
                this.txtWidth = ((System.Windows.Controls.TextBox)(target));

            #line 478 "..\..\..\MainWindow.xaml"
                this.txtWidth.LostFocus += new System.Windows.RoutedEventHandler(this.TextBox_LostFocus);

            #line default
            #line hidden

            #line 478 "..\..\..\MainWindow.xaml"
                this.txtWidth.TextInput += new System.Windows.Input.TextCompositionEventHandler(this.TextBox_TextInput);

            #line default
            #line hidden
                return;

            case 34:
                this.txtHeight = ((System.Windows.Controls.TextBox)(target));

            #line 482 "..\..\..\MainWindow.xaml"
                this.txtHeight.LostFocus += new System.Windows.RoutedEventHandler(this.TextBox_LostFocus);

            #line default
            #line hidden

            #line 482 "..\..\..\MainWindow.xaml"
                this.txtHeight.TextInput += new System.Windows.Input.TextCompositionEventHandler(this.TextBox_TextInput);

            #line default
            #line hidden
                return;

            case 35:
                this.colorPicker = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
                return;

            case 36:
                this.UpdateUser = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 37:
                this.CreateUser = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 38:

            #line 571 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 39:
                this.tabItem1 = ((Fluent.RibbonTabItem)(target));
                return;

            case 40:
                this.OperationGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

            case 41:
                this.btnPageAdd = ((Fluent.Button)(target));

            #line 601 "..\..\..\MainWindow.xaml"
                this.btnPageAdd.Click += new System.Windows.RoutedEventHandler(this.btnPageAdd_Click);

            #line default
            #line hidden
                return;

            case 42:

            #line 607 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 43:

            #line 608 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 44:
                this.btnPageDel = ((Fluent.Button)(target));

            #line 634 "..\..\..\MainWindow.xaml"
                this.btnPageDel.Click += new System.Windows.RoutedEventHandler(this.btnPageDel_Click);

            #line default
            #line hidden
                return;

            case 45:
                this.btnUndo = ((Fluent.Button)(target));

            #line 650 "..\..\..\MainWindow.xaml"
                this.btnUndo.Click += new System.Windows.RoutedEventHandler(this.btnUndo_Click);

            #line default
            #line hidden
                return;

            case 46:
                this.btnRedo = ((Fluent.Button)(target));

            #line 665 "..\..\..\MainWindow.xaml"
                this.btnRedo.Click += new System.Windows.RoutedEventHandler(this.btnRedo_Click);

            #line default
            #line hidden
                return;

            case 47:
                this.toggleButton1 = ((Fluent.SplitButton)(target));
                return;

            case 48:

            #line 689 "..\..\..\MainWindow.xaml"
                ((Fluent.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AlignButton_Click);

            #line default
            #line hidden
                return;

            case 49:

            #line 690 "..\..\..\MainWindow.xaml"
                ((Fluent.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AlignButton_Click);

            #line default
            #line hidden
                return;

            case 50:

            #line 691 "..\..\..\MainWindow.xaml"
                ((Fluent.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AlignButton_Click);

            #line default
            #line hidden
                return;

            case 51:

            #line 692 "..\..\..\MainWindow.xaml"
                ((Fluent.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AlignButton_Click);

            #line default
            #line hidden
                return;

            case 52:
                this.q = ((Fluent.RibbonGroupBox)(target));
                return;

            case 53:
                this.btnCut = ((Fluent.Button)(target));

            #line 708 "..\..\..\MainWindow.xaml"
                this.btnCut.Click += new System.Windows.RoutedEventHandler(this.btnCut_Click);

            #line default
            #line hidden
                return;

            case 54:
                this.btnCopy = ((Fluent.Button)(target));

            #line 725 "..\..\..\MainWindow.xaml"
                this.btnCopy.Click += new System.Windows.RoutedEventHandler(this.btnCopy_Click);

            #line default
            #line hidden
                return;

            case 55:
                this.btnPaste = ((Fluent.Button)(target));

            #line 740 "..\..\..\MainWindow.xaml"
                this.btnPaste.Click += new System.Windows.RoutedEventHandler(this.btnPaste_Click);

            #line default
            #line hidden
                return;

            case 56:
                this.ViewGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

            case 57:
                this.Preview = ((Fluent.Button)(target));

            #line 757 "..\..\..\MainWindow.xaml"
                this.Preview.Click += new System.Windows.RoutedEventHandler(this.Preview_Click);

            #line default
            #line hidden
                return;

            case 58:
                this.btnPublish = ((Fluent.Button)(target));

            #line 775 "..\..\..\MainWindow.xaml"
                this.btnPublish.Click += new System.Windows.RoutedEventHandler(this.btnPublish_Click);

            #line default
            #line hidden
                return;

            case 59:
                this.tabItem2 = ((Fluent.RibbonTabItem)(target));
                return;

            case 60:
                this.ResourcesRibbonGroupBox = ((Fluent.RibbonGroupBox)(target));
                return;

            case 61:

            #line 909 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SplitButton_Click);

            #line default
            #line hidden
                return;

            case 62:

            #line 924 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SplitButton_Click);

            #line default
            #line hidden
                return;

            case 63:

            #line 938 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SplitButton_Click);

            #line default
            #line hidden
                return;

            case 64:

            #line 967 "..\..\..\MainWindow.xaml"
                ((Fluent.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SplitButton_Click);

            #line default
            #line hidden
                return;

            case 65:
                this.tabItem6 = ((Fluent.RibbonTabItem)(target));
                return;

            case 66:
                this.btnHelp = ((Fluent.Button)(target));

            #line 1257 "..\..\..\MainWindow.xaml"
                this.btnHelp.Click += new System.Windows.RoutedEventHandler(this.btnHelp_Click);

            #line default
            #line hidden
                return;

            case 67:
                this.btnfeedback = ((Fluent.Button)(target));

            #line 1267 "..\..\..\MainWindow.xaml"
                this.btnfeedback.Click += new System.Windows.RoutedEventHandler(this.Button_Click_6);

            #line default
            #line hidden
                return;

            case 68:
                this.treeViewControl1 = ((System.Windows.Controls.TreeView)(target));

            #line 1315 "..\..\..\MainWindow.xaml"
                this.treeViewControl1.PreviewDragEnter += new System.Windows.DragEventHandler(this.TextBlock_PreviewDragEnter);

            #line default
            #line hidden

            #line 1316 "..\..\..\MainWindow.xaml"
                this.treeViewControl1.PreviewDragLeave += new System.Windows.DragEventHandler(this.TextBlock_PreviewDragLeave);

            #line default
            #line hidden

            #line 1317 "..\..\..\MainWindow.xaml"
                this.treeViewControl1.PreviewDragOver += new System.Windows.DragEventHandler(this.treeViewControl1_PreviewDragOver);

            #line default
            #line hidden

            #line 1318 "..\..\..\MainWindow.xaml"
                this.treeViewControl1.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.treeViewControl1_SelectedItemChanged);

            #line default
            #line hidden

            #line 1321 "..\..\..\MainWindow.xaml"
                this.treeViewControl1.Drop += new System.Windows.DragEventHandler(this.PubDropTreeAndBlockEvent);

            #line default
            #line hidden
                return;

            case 69:
                this.scrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 70:
                this.grid = ((System.Windows.Controls.Grid)(target));
                return;

            case 71:
                this.scaleTransform = ((System.Windows.Media.ScaleTransform)(target));
                return;

            case 72:
                this.propertyManage1 = ((jg.Editor.Library.Property.PropertyManage)(target));
                return;

            case 73:
                this.controlTimeLine = ((jg.Editor.Library.ControlTimeLine)(target));
                return;

            case 74:
                this.zoomSlider = ((System.Windows.Controls.Slider)(target));

            #line 1428 "..\..\..\MainWindow.xaml"
                this.zoomSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.zoomSlider_ValueChanged);

            #line default
            #line hidden
                return;

            case 75:
                this.ShowNewWin = ((System.Windows.Controls.Grid)(target));
                return;

            case 76:
                this.ProgressEditBusyName = ((jg.Editor.Library.Control.ProgressEditBusy)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #36
0
 // Handles visibility changed
 private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     RibbonGroupBox box = (d as RibbonGroupBox);
     box.ClearCache();
 }
            /// <summary>
            /// Creates the ribbon menu bar for the html editor.
            /// </summary>
            /// <param name="ribbonMenu">Main ribbon menu.</param>
            public override void CreateRibbonMenuBar(Fluent.Ribbon ribbonMenu)
            {
                foreach (RibbonContextualTabGroup t in ribbonMenu.ContextualGroups)
                    if (t.Name == "tabGroupHtml")
                        return;

                // add contextual items for the html editor
                RibbonContextualTabGroup contextualTG = new RibbonContextualTabGroup();
                contextualTG.Name = "tabGroupHtml";
                contextualTG.BorderBrush = new SolidColorBrush(Colors.Orange);
                contextualTG.Background = new SolidColorBrush(Colors.OrangeRed);
                contextualTG.Header = "Html-Editor";

                Binding visibilityBinding = new Binding("ActiveViewModel.SelectedEditorViewModel.IsHtmlEditorViewModelVisible");
                visibilityBinding.Converter = new BooleanToVisibilityConverter();
                visibilityBinding.Mode = BindingMode.OneWay;
                contextualTG.SetBinding(RibbonContextualTabGroup.VisibilityProperty, visibilityBinding);

                // add the html editor tab item
                RibbonTabItem tab = new RibbonTabItem();
                tab.Group = contextualTG;
                tab.Header = "Design";

                // font group box
                RibbonGroupBox fontGP = new RibbonGroupBox();
                fontGP.Header = "Font";
                tab.Groups.Add(fontGP);

                #region Button Bold
                Fluent.ToggleButton btnBold = new Fluent.ToggleButton();
                btnBold.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnBold.SizeDefinition = "Large";
                btnBold.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-bold-32.png"));
                btnBold.Text = "Bold";

                Binding btnBoldCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleBoldCommand");
                btnBoldCmdn.Mode = BindingMode.OneWay;
                btnBold.SetBinding(Fluent.ToggleButton.CommandProperty, btnBoldCmdn);

                Binding btnBoldIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextBold");
                btnBoldIsChecked.Mode = BindingMode.TwoWay;
                btnBold.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnBoldIsChecked);

                fontGP.Items.Add(btnBold);
                #endregion

                #region Button Italic
                Fluent.ToggleButton btnItalic = new Fluent.ToggleButton();
                btnItalic.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnItalic.SizeDefinition = "Large";
                btnItalic.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-italic-32.png"));
                btnItalic.Text = "Italic";

                Binding btnItalicCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleItalicCommand");
                btnItalicCmdn.Mode = BindingMode.OneWay;
                btnItalic.SetBinding(Fluent.ToggleButton.CommandProperty, btnItalicCmdn);

                Binding btnItalicIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextItalic");
                btnItalicIsChecked.Mode = BindingMode.TwoWay;
                btnItalic.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnItalicIsChecked);

                fontGP.Items.Add(btnItalic);
                #endregion

                #region Button Underline
                Fluent.ToggleButton btnUnderline = new Fluent.ToggleButton();
                btnUnderline.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnUnderline.SizeDefinition = "Large";
                btnUnderline.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-underline-32.png"));
                btnUnderline.Text = "Underline";

                Binding btnUnderlineCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleUnderlineCommand");
                btnUnderlineCmdn.Mode = BindingMode.OneWay;
                btnUnderline.SetBinding(Fluent.ToggleButton.CommandProperty, btnUnderlineCmdn);

                Binding btnUnderlineIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextUnderlined");
                btnUnderlineIsChecked.Mode = BindingMode.TwoWay;
                btnUnderline.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnUnderlineIsChecked);

                fontGP.Items.Add(btnUnderline);
                #endregion

                // format group box
                RibbonGroupBox formatGP = new RibbonGroupBox();
                formatGP.Header = "Format";
                tab.Groups.Add(formatGP);

                #region Button Decrease Indent
                Fluent.Button btnDecIndent = new Fluent.Button();
                btnDecIndent.SizeDefinition = "Large";
                btnDecIndent.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-indent-less-32.png"));
                btnDecIndent.Text = "Decrease Indent";

                Binding btnDecIndentCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlIndentLessCommand");
                btnDecIndentCmdn.Mode = BindingMode.OneWay;
                btnDecIndent.SetBinding(Fluent.Button.CommandProperty, btnDecIndentCmdn);

                formatGP.Items.Add(btnDecIndent);
                #endregion

                #region Button Increase Indent
                Fluent.Button btnIncIndent = new Fluent.Button();
                btnIncIndent.SizeDefinition = "Large";
                btnIncIndent.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-indent-more-32.png"));
                btnIncIndent.Text = "Increase Indent";

                Binding btnIncIndentCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlIndentMoreCommand");
                btnIncIndentCmdn.Mode = BindingMode.OneWay;
                btnIncIndent.SetBinding(Fluent.Button.CommandProperty, btnIncIndentCmdn);

                formatGP.Items.Add(btnIncIndent);
                #endregion

                // alignment group box
                RibbonGroupBox alignGP = new RibbonGroupBox();
                alignGP.Header = "Alignment";
                tab.Groups.Add(alignGP);

                #region Button Align Left
                Fluent.ToggleButton btnLeft = new Fluent.ToggleButton();
                btnLeft.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnLeft.SizeDefinition = "Large";
                btnLeft.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-left-32.png"));
                btnLeft.Text = "Left";

                Binding btnLeftCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignLeftCommand");
                btnLeftCmdn.Mode = BindingMode.OneWay;
                btnLeft.SetBinding(Fluent.ToggleButton.CommandProperty, btnLeftCmdn);

                Binding btnLeftIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedLeft");
                btnLeftIsChecked.Mode = BindingMode.TwoWay;
                btnLeft.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnLeftIsChecked);

                alignGP.Items.Add(btnLeft);
                #endregion

                #region Button Align Center
                Fluent.ToggleButton btnCenter = new Fluent.ToggleButton();
                btnCenter.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnCenter.SizeDefinition = "Large";
                btnCenter.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-center-32.png"));
                btnCenter.Text = "Center";

                Binding btnCenterCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignCenterCommand");
                btnCenterCmdn.Mode = BindingMode.OneWay;
                btnCenter.SetBinding(Fluent.ToggleButton.CommandProperty, btnCenterCmdn);

                Binding btnCenterIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedCenter");
                btnCenterIsChecked.Mode = BindingMode.TwoWay;
                btnCenter.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnCenterIsChecked);

                alignGP.Items.Add(btnCenter);
                #endregion

                #region Button Align Right
                Fluent.ToggleButton btnRight = new Fluent.ToggleButton();
                btnRight.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnRight.SizeDefinition = "Large";
                btnRight.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-right-32.png"));
                btnRight.Text = "Right";

                Binding btnRightCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignRightCommand");
                btnRightCmdn.Mode = BindingMode.OneWay;
                btnRight.SetBinding(Fluent.ToggleButton.CommandProperty, btnRightCmdn);

                Binding btnRightIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedRight");
                btnRightIsChecked.Mode = BindingMode.TwoWay;
                btnRight.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnRightIsChecked);

                alignGP.Items.Add(btnRight);
                #endregion

                #region Button Align Justify
                Fluent.ToggleButton btnJustify = new Fluent.ToggleButton();
                btnJustify.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnJustify.SizeDefinition = "Large";
                btnJustify.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-fill-32.png"));
                btnJustify.Text = "Justify";

                Binding btnJustifyCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignJustifyCommand");
                btnJustifyCmdn.Mode = BindingMode.OneWay;
                btnJustify.SetBinding(Fluent.ToggleButton.CommandProperty, btnJustifyCmdn);

                Binding btnJustifyIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedJustified");
                btnJustifyIsChecked.Mode = BindingMode.TwoWay;
                btnJustify.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnJustifyIsChecked);

                alignGP.Items.Add(btnJustify);
                #endregion

                // insert group box
                RibbonGroupBox insertGP = new RibbonGroupBox();
                insertGP.Header = "Insert";
                tab.Groups.Add(insertGP);

                #region Button Hyperlink
                Fluent.Button btnHyperlink = new Fluent.Button();
                btnHyperlink.SizeDefinition = "Large";
                btnHyperlink.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/Hyperlink.ico"));
                btnHyperlink.Text = "Hyperlink";

                Binding btnHyperlinkCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertHyperlinkCommand");
                btnHyperlinkCmdn.Mode = BindingMode.OneWay;
                btnHyperlink.SetBinding(Fluent.Button.CommandProperty, btnHyperlinkCmdn);

                insertGP.Items.Add(btnHyperlink);
                #endregion

                #region Button Image
                Fluent.Button btnImage = new Fluent.Button();
                btnImage.SizeDefinition = "Large";
                btnImage.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/insert-image-32.png"));
                btnImage.Text = "Image";

                Binding btnImageCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertImageCommand");
                btnImageCmdn.Mode = BindingMode.OneWay;
                btnImage.SetBinding(Fluent.Button.CommandProperty, btnImageCmdn);

                insertGP.Items.Add(btnImage);
                #endregion

                #region Button List
                Fluent.SplitButton btnList = new SplitButton();
                btnList.SizeDefinition = "Large";
                btnList.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/list-32.png"));
                btnList.Text = "List";
                insertGP.Items.Add(btnList);

                Fluent.Button btnBulletedList = new Fluent.Button();
                btnBulletedList.SizeDefinition = "Middle";
                btnBulletedList.Icon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/List_BulletsHS.png"));
                btnBulletedList.Text = "Bulleted List";

                Binding btnBulletedListCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertBulletListCommand");
                btnBulletedListCmdn.Mode = BindingMode.OneWay;
                btnBulletedList.SetBinding(Fluent.Button.CommandProperty, btnBulletedListCmdn);

                btnList.Items.Add(btnBulletedList);

                Fluent.Button btnNumberedList = new Fluent.Button();
                btnNumberedList.SizeDefinition = "Middle";
                btnNumberedList.Icon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/List_NumberedHS.png"));
                btnNumberedList.Text = "Numbered List";

                Binding btnNumberedListCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertNumberListCommand");
                btnNumberedListCmdn.Mode = BindingMode.OneWay;
                btnNumberedList.SetBinding(Fluent.Button.CommandProperty, btnNumberedListCmdn);

                btnList.Items.Add(btnNumberedList);
                #endregion

                #region Button Table
                Fluent.Button btnTable = new Fluent.Button();
                btnTable.SizeDefinition = "Large";
                btnTable.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/table-32.png"));
                btnTable.Text = "Table";

                Binding btnTableCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertTableCommand");
                btnTableCmdn.Mode = BindingMode.OneWay;
                btnTable.SetBinding(Fluent.Button.CommandProperty, btnTableCmdn);

                insertGP.Items.Add(btnTable);
                #endregion

                ribbonMenu.ContextualGroups.Add(contextualTG);
                ribbonMenu.Tabs.Add(tab);

                /*
                <fluent:RibbonGroupBox Header="Font">
                        <fluent:ToggleButton Text="Bold" Command="{Binding Path=HtmlToggleBoldCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-bold-32.png" IsChecked="{Binding Path=IsSelectionTextBold, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Italic" Command="{Binding Path=HtmlToggleItalicCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-italic-32.png" IsChecked="{Binding Path=IsSelectionTextItalic, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Underline" Command="{Binding Path=HtmlToggleUnderlineCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-underline-32.png" IsChecked="{Binding Path=IsSelectionTextUnderlined, Mode=TwoWay}" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Format">
                        <fluent:Button Text="Decrease Indent" Command="{Binding Path=HtmlIndentLessCommand}" LargeIcon="/Resources/Images/HtmlEditor/format-indent-less-32.png"  SizeDefinition="Large"/>
                        <fluent:Button Text="Increase Indent" Command="{Binding Path=HtmlIndentMoreCommand}" LargeIcon="/Resources/Images/HtmlEditor/format-indent-more-32.png" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Font">
                        <fluent:ToggleButton Text="Left" Command="{Binding Path=HtmlAlignLeftCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-left-32.png" IsChecked="{Binding Path=IsSelectionAlignedLeft, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Center" Command="{Binding Path=HtmlAlignCenterCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-center-32.png" IsChecked="{Binding Path=IsSelectionAlignedCenter, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Right" Command="{Binding Path=HtmlAlignRightCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-right-32.png" IsChecked="{Binding Path=IsSelectionAlignedRight, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Justify" Command="{Binding Path=HtmlAlignJustifyCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-fill-32.png" IsChecked="{Binding Path=IsSelectionAlignedJustified, Mode=TwoWay}" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Insert">
                        <fluent:Button Text="Hyperlink" Command="{Binding Path=HtmlInsertHyperlinkCommand}" LargeIcon="/Resources/Images/Ico/Hyperlink.ico"  SizeDefinition="Large"/>
                        <fluent:Button Text="Image" Command="{Binding Path=HtmlInsertImageCommand}" LargeIcon="/Resources/Images/HtmlEditor/insert-image-32.png" SizeDefinition="Large"/>
                        <fluent:SplitButton Text="List" LargeIcon="/Resources/Images/HtmlEditor/list-32.png" SizeDefinition="Large">
                            <fluent:Button Text="Bulleted List" Command="{Binding Path=HtmlInsertBulletListCommand}" Icon="/Resources/Images/HtmlEditor/List_BulletsHS.png" SizeDefinition="Middle"/>
                            <fluent:Button Text="Numbered List" Command="{Binding Path=HtmlInsertNumberListCommand}" Icon="/Resources/Images/HtmlEditor/List_NumberedHS.png" SizeDefinition="Middle"/>
                        </fluent:SplitButton>
                        <fluent:Button Text="Table" Command="{Binding Path=HtmlInsertTableCommand}" LargeIcon="/Resources/Images/HtmlEditor/table-32.png" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>
                */
            }
    private void btnTest_Click(object sender, RoutedEventArgs e) {
      /*
		We could easily move this to another project and send that method			 
		*/

      //Following could be an example of what the most basic plugin could look like
      //We could also separate plugins so they could be enabled WHEN
      //Always OR Folder_Selected OR File_Selected 
      Action<string, string> pluginExampleActivateBasic = (string pluginPath, string currentFileOrFolder) => Process.Start(pluginPath, currentFileOrFolder);

      var Tab = new Fluent.RibbonTabItem() { Header = "Plugins", ToolTip = "Plugins" };
      TheRibbon.Tabs.Add(Tab);
      var groupBox1 = new RibbonGroupBox() { Header = "Test" };
      Tab.Groups.Add(groupBox1);
      var XML =
                                      @"<Shortcuts>
						<Shortcut Name='Test' Path = 'C:\Aaron'/>
					</Shortcuts>";

      var xDoc = XElement.Parse(XML);
      var shortcuts = xDoc.Elements("Shortcut");

      var dropDown = new SplitButton();
      groupBox1.Items.Add(dropDown);

      foreach (var Node in xDoc.Elements("Shortcut")) {
        var item = new MenuItem() { Header = Node.Attribute("Name").Value };
        item.Click += (x, y) => Process.Start(Node.Attribute("Path").Value);
        dropDown.Items.Add(item);
      }
    }
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original 
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            var groupBox = new RibbonGroupBox();

            RibbonControl.BindQuickAccessItem(this, groupBox);

            groupBox.DropDownOpened += this.OnQuickAccessOpened;
            groupBox.DropDownClosed += this.OnQuickAccessClosed;
            
            groupBox.State = RibbonGroupBoxState.QuickAccess;

            RibbonControl.Bind(this, groupBox, "ItemTemplateSelector", ItemTemplateSelectorProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "ItemTemplate", ItemTemplateProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "ItemsSource", ItemsSourceProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommandParameter", LauncherCommandParameterProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommand", LauncherCommandProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherCommandTarget", LauncherCommandTargetProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherIcon", LauncherIconProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherText", LauncherTextProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "LauncherToolTip", LauncherToolTipProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "IsLauncherEnabled", IsLauncherEnabledProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "IsLauncherVisible", IsLauncherVisibleProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, "DialogLauncherButtonKeyTipKeys", DialogLauncherButtonKeyTipKeysProperty, BindingMode.OneWay);
            groupBox.LauncherClick += this.LauncherClick;

            var toolTip = this.ToolTip as ToolTip;
            if ((toolTip == null || toolTip.ToolTip == null) && this.Header != null)
            {
                RibbonControl.Bind(this, groupBox, "Header", ToolTipProperty, BindingMode.OneWay);
            }

            if (this.Icon != null)
            {
                var iconVisual = this.Icon as Visual;
                if (iconVisual != null)
                {
                    var rect = new Rectangle
                    {
                        Width = 16,
                        Height = 16,
                        Fill = new VisualBrush(iconVisual)
                    };
                    groupBox.Icon = rect;
                }
                else
                {
                    RibbonControl.Bind(this, groupBox, "Icon", RibbonControl.IconProperty, BindingMode.OneWay);
                }
            }

            if (this.Header != null)
            {
                RibbonControl.Bind(this, groupBox, "Header", RibbonControl.HeaderProperty, BindingMode.OneWay);
            }

            return groupBox;
        }
        /// <summary>
        /// Gets control which represents shortcut item.
        /// This item MUST be syncronized with the original 
        /// and send command to original one control.
        /// </summary>
        /// <returns>Control which represents shortcut item</returns>
        public FrameworkElement CreateQuickAccessItem()
        {
            var groupBox = new RibbonGroupBox();

            RibbonControl.BindQuickAccessItem(this, groupBox);

            groupBox.DropDownOpened += this.OnQuickAccessOpened;
            groupBox.DropDownClosed += this.OnQuickAccessClosed;

            groupBox.State = RibbonGroupBoxState.QuickAccess;

            RibbonControl.Bind(this, groupBox, nameof(this.ItemTemplateSelector), ItemTemplateSelectorProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.ItemTemplate), ItemTemplateProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.ItemsSource), ItemsSourceProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommandParameter), LauncherCommandParameterProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommand), LauncherCommandProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherCommandTarget), LauncherCommandTargetProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherIcon), LauncherIconProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherText), LauncherTextProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherToolTip), LauncherToolTipProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.IsLauncherEnabled), IsLauncherEnabledProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.IsLauncherVisible), IsLauncherVisibleProperty, BindingMode.OneWay);
            RibbonControl.Bind(this, groupBox, nameof(this.LauncherKeys), DialogLauncherButtonKeyTipKeysProperty, BindingMode.OneWay);
            groupBox.LauncherClick += this.LauncherClick;

            if (this.Icon != null)
            {
                var iconVisual = this.Icon as Visual;
                if (iconVisual != null)
                {
                    var rect = new Rectangle
                    {
                        Width = 16,
                        Height = 16,
                        Fill = new VisualBrush(iconVisual)
                    };
                    groupBox.Icon = rect;
                }
                else
                {
                    RibbonControl.Bind(this, groupBox, nameof(this.Icon), RibbonControl.IconProperty, BindingMode.OneWay);
                }
            }

            return groupBox;
        }