public static BindQuickAccessItem ( |
||
source | Source item | |
element | Toolbar item | |
return | void |
/// <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() { CheckBox button = new CheckBox(); RibbonControl.Bind(this, button, "IsChecked", IsCheckedProperty, BindingMode.TwoWay); button.Click += ((sender, e) => RaiseEvent(e)); RibbonControl.BindQuickAccessItem(this, button); return(button); }
/// <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() { var button = new RadioButton(); RibbonControl.Bind(this, button, nameof(this.IsChecked), IsCheckedProperty, BindingMode.TwoWay); button.Click += (sender, e) => this.RaiseEvent(e); RibbonControl.BindQuickAccessItem(this, button); return(button); }
/// <summary> /// This method must be overridden to bind properties to use in quick access creating /// </summary> /// <param name="element">Toolbar item</param> protected virtual void BindQuickAccessItem(FrameworkElement element) { RibbonControl.BindQuickAccessItem(this, element); var textBoxQAT = (TextBox)element; textBoxQAT.Width = this.Width; this.ForwardBindingsForQAT(this, textBoxQAT); RibbonControl.BindQuickAccessItem(this, element); }
/// <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); }
/// <inheritdoc /> public virtual FrameworkElement CreateQuickAccessItem() { if (this.HasItems) { if (this.IsSplited) { var button = new SplitButton { CanAddButtonToQuickAccessToolBar = false }; RibbonControl.BindQuickAccessItem(this, button); RibbonControl.Bind(this, button, nameof(this.ResizeMode), ResizeModeProperty, BindingMode.Default); RibbonControl.Bind(this, button, nameof(this.MaxDropDownHeight), MaxDropDownHeightProperty, BindingMode.Default); RibbonControl.Bind(this, button, nameof(this.DisplayMemberPath), DisplayMemberPathProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.GroupStyleSelector), GroupStyleSelectorProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemContainerStyle), ItemContainerStyleProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemsPanel), ItemsPanelProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemStringFormat), ItemStringFormatProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemTemplate), ItemTemplateProperty, BindingMode.OneWay); button.DropDownOpened += this.OnQuickAccessOpened; return(button); } else { var button = new DropDownButton(); RibbonControl.BindQuickAccessItem(this, button); RibbonControl.Bind(this, button, nameof(this.ResizeMode), ResizeModeProperty, BindingMode.Default); RibbonControl.Bind(this, button, nameof(this.MaxDropDownHeight), MaxDropDownHeightProperty, BindingMode.Default); RibbonControl.Bind(this, button, nameof(this.DisplayMemberPath), DisplayMemberPathProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.GroupStyleSelector), GroupStyleSelectorProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemContainerStyle), ItemContainerStyleProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemsPanel), ItemsPanelProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemStringFormat), ItemStringFormatProperty, BindingMode.OneWay); RibbonControl.Bind(this, button, nameof(this.ItemTemplate), ItemTemplateProperty, BindingMode.OneWay); button.DropDownOpened += this.OnQuickAccessOpened; return(button); } } else { var button = new Button(); RibbonControl.BindQuickAccessItem(this, button); return(button); } }
/// <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); }
/// <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); }
/// <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 (this.HasItems) { if (this.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 += this.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 += this.OnQuickAccessOpened; return(button); } } else { Button button = new Button(); RibbonControl.BindQuickAccessItem(this, button); return(button); } }
/// <inheritdoc /> protected override void BindQuickAccessItem(FrameworkElement element) { RibbonControl.Bind(this, element, nameof(this.DisplayMemberPath), DisplayMemberPathProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.GroupStyleSelector), GroupStyleSelectorProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.ItemContainerStyle), ItemContainerStyleProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.ItemsPanel), ItemsPanelProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.ItemStringFormat), ItemStringFormatProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.ItemTemplate), ItemTemplateProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.MaxDropDownHeight), MaxDropDownHeightProperty, BindingMode.OneWay); RibbonControl.Bind(this, element, nameof(this.IsChecked), IsCheckedProperty, BindingMode.TwoWay); RibbonControl.Bind(this, element, nameof(this.DropDownToolTip), DropDownToolTipProperty, BindingMode.TwoWay); RibbonControl.Bind(this, element, nameof(this.IsCheckable), IsCheckableProperty, BindingMode.Default); RibbonControl.Bind(this, element, nameof(this.IsButtonEnabled), IsButtonEnabledProperty, BindingMode.Default); RibbonControl.Bind(this, element, nameof(this.ContextMenu), ContextMenuProperty, BindingMode.Default); RibbonControl.Bind(this, element, nameof(this.ResizeMode), ResizeModeProperty, BindingMode.Default); RibbonControl.Bind(this, element, nameof(this.MaxDropDownHeight), MaxDropDownHeightProperty, BindingMode.Default); RibbonControl.Bind(this, element, nameof(this.HasTriangle), HasTriangleProperty, BindingMode.Default); RibbonControl.BindQuickAccessItem(this, element); }