Exemple #1
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 virtual FrameworkElement CreateQuickAccessItem()
        {
            ToggleButton button = new ToggleButton();

            RibbonControl.Bind(this, button, "IsChecked", IsCheckedProperty, BindingMode.TwoWay);
            button.Click += ((sender, e) => RaiseEvent(e));
            RibbonControl.BindQuickAccessItem(this, button);

            return(button);
        }
Exemple #2
0
 /// <summary>
 /// This method must be overridden to bind properties to use in quick access creating
 /// </summary>
 /// <param name="element">Toolbar item</param>
 protected override void BindQuickAccessItem(FrameworkElement element)
 {
     RibbonControl.Bind(this, element, "DisplayMemberPath", DisplayMemberPathProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "GroupStyleSelector", GroupStyleSelectorProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "ItemContainerStyle", ItemContainerStyleProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "ItemsPanel", ItemsPanelProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "ItemStringFormat", ItemStringFormatProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "ItemTemplate", ItemTemplateProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "MaxDropDownHeight", MaxDropDownHeightProperty, BindingMode.OneWay);
     RibbonControl.Bind(this, element, "IsChecked", IsCheckedProperty, BindingMode.TwoWay);
     RibbonControl.Bind(this, element, "DropDownToolTip", DropDownToolTipProperty, BindingMode.TwoWay);
     RibbonControl.Bind(this, element, "IsCheckable", IsCheckableProperty, BindingMode.Default);
     RibbonControl.Bind(this, element, "IsButtonEnabled", IsButtonEnabledProperty, BindingMode.Default);
     RibbonControl.Bind(this, element, "ContextMenu", ContextMenuProperty, BindingMode.Default);
     RibbonControl.BindQuickAccessItem(this, element);
     RibbonControl.Bind(this, element, "ResizeMode", ResizeModeProperty, BindingMode.Default);
     RibbonControl.Bind(this, element, "MaxDropDownHeight", MaxDropDownHeightProperty, BindingMode.Default);
     RibbonControl.Bind(this, element, "HasTriangle", HasTriangleProperty, BindingMode.Default);
 }
Exemple #3
0
        /// <summary>
        /// This method must be overriden to bind properties to use in quick access creating
        /// </summary>
        /// <param name="element">Toolbar item</param>
        protected void BindQuickAccessItem(FrameworkElement element)
        {
            Spinner spinner = (Spinner)element;

            RibbonControl.BindQuickAccessItem(this, element);

            spinner.Width      = Width;
            spinner.InputWidth = InputWidth;

            Bind(this, spinner, "Value", ValueProperty, BindingMode.TwoWay);
            Bind(this, spinner, "Increment", IncrementProperty, BindingMode.OneWay);
            Bind(this, spinner, "Minimum", MinimumProperty, BindingMode.OneWay);
            Bind(this, spinner, "Maximum", MaximumProperty, BindingMode.OneWay);
            Bind(this, spinner, "Format", FormatProperty, BindingMode.OneWay);
            Bind(this, spinner, "Delay", DelayProperty, BindingMode.OneWay);
            Bind(this, spinner, "Interval", IntervalProperty, BindingMode.OneWay);

            RibbonControl.BindQuickAccessItem(this, element);
        }
Exemple #4
0
 /// <summary>
 /// Gets control which represents shortcut item.
 /// This item MUST be synchronized with the original
 /// and send command to original one control.
 /// </summary>
 /// <returns>Control which represents shortcut item</returns>
 public FrameworkElement CreateQuickAccessItem()
 {
     if (HasItems)
     {
         if (IsSplited)
         {
             SplitButton button = new SplitButton();
             RibbonControl.BindQuickAccessItem(this, button);
             RibbonControl.Bind(this, button, "ResizeMode", ResizeModeProperty, BindingMode.Default);
             RibbonControl.Bind(this, button, "MaxDropDownHeight", MaxDropDownHeightProperty, BindingMode.Default);
             RibbonControl.Bind(this, button, "DisplayMemberPath", DisplayMemberPathProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "GroupStyleSelector", GroupStyleSelectorProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemContainerStyle", ItemContainerStyleProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemsPanel", ItemsPanelProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemStringFormat", ItemStringFormatProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemTemplate", ItemTemplateProperty, BindingMode.OneWay);
             button.DropDownOpened += OnQuickAccessOpened;
             return(button);
         }
         else
         {
             DropDownButton button = new DropDownButton();
             RibbonControl.BindQuickAccessItem(this, button);
             RibbonControl.Bind(this, button, "ResizeMode", ResizeModeProperty, BindingMode.Default);
             RibbonControl.Bind(this, button, "MaxDropDownHeight", MaxDropDownHeightProperty, BindingMode.Default);
             RibbonControl.Bind(this, button, "DisplayMemberPath", DisplayMemberPathProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "GroupStyleSelector", GroupStyleSelectorProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemContainerStyle", ItemContainerStyleProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemsPanel", ItemsPanelProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemStringFormat", ItemStringFormatProperty, BindingMode.OneWay);
             RibbonControl.Bind(this, button, "ItemTemplate", ItemTemplateProperty, BindingMode.OneWay);
             button.DropDownOpened += OnQuickAccessOpened;
             return(button);
         }
     }
     else
     {
         Button button = new Button();
         RibbonControl.BindQuickAccessItem(this, button);
         return(button);
     }
 }