Class RadRibbonBarElement
Represents a ribbon bar element. The RadRibbonBarElement can be nested in other telerik controls. Essentially RadRibbonBar class is a simple wrapper for RadRibbonBarElement class. RadRibbonBar acts to transfer events to and from the its corresponding instance of the RadRibbonBarElement.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[ComVisible(false)]
public class RadRibbonBarElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadRibbonBarElement()
Initializes a new instance of the RadRibbonBarElement class.
Declaration
public RadRibbonBarElement()
Fields
IsBackstageModeProperty
IsRibbonFormActiveProperty
QuickAccessMenuHeightProperty
QuickAccessToolbarBelowRibbonProperty
RibbonFormWindowStateProperty
SimplifiedHeightProperty
Properties
ApplicationButtonElement
Gets the application menu button element.
Declaration
public RadApplicationMenuButtonElement ApplicationButtonElement { get; }
Property Value
RadApplicationMenuButtonElement
|
ApplicationMenuRightColumnWidth
Gets or sets the width of the right column in the application menu.
Declaration
public int ApplicationMenuRightColumnWidth { get; set; }
Property Value
System.Int32
|
ApplicationMenuStyle
Gets or sets the application menu style for the ribbon bar.
Declaration
public ApplicationMenuStyle ApplicationMenuStyle { get; set; }
Property Value
ApplicationMenuStyle
|
BackstageControl
Gets or sets the backstage control used for the backstage view.
Declaration
public RadRibbonBarBackstageView BackstageControl { get; set; }
Property Value
RadRibbonBarBackstageView
|
ButtonsContainer
Gets the stack layout element that contains the buttons in the ribbon bar caption.
Declaration
public StackLayoutElement ButtonsContainer { get; }
Property Value
StackLayoutElement
|
CaptionBorder
Gets the BorderPrimitive instance that represents the border of the ribbon's caption.
Declaration
public BorderPrimitive CaptionBorder { get; }
Property Value
BorderPrimitive
|
CaptionFill
Gets the FillPrimitive instance that represents the fill of the ribbon's caption.
Declaration
public FillPrimitive CaptionFill { get; }
Property Value
FillPrimitive
|
CloseButton
Gets or sets a value indicating whether the close button is visible in the ribbon caption.
Declaration
public bool CloseButton { get; set; }
Property Value
System.Boolean
|
CollapseRibbonOnTabDoubleClick
Gets or sets a value indicating whether the ribbon bar will be collapsed or expanded on ribbon tab double click.
Declaration
public bool CollapseRibbonOnTabDoubleClick { get; set; }
Property Value
System.Boolean
|
CollapsingEnabled
Gets or sets a boolean value determining whether the groups are collapsed according to the ribbon's size.
Declaration
public bool CollapsingEnabled { get; set; }
Property Value
System.Boolean
|
CommandTabs
Gets a collection of the command tabs.
Declaration
[RadEditItemsAction]
public RadRibbonBarCommandTabCollection CommandTabs { get; }
Property Value
RadRibbonBarCommandTabCollection
|
ContextualTabGroups
Gets a collection of contextual tab groups.
Declaration
[RadNewItem("Add New Group...", true, true, false)]
public RadItemOwnerCollection ContextualTabGroups { get; }
Property Value
RadItemOwnerCollection
|
ExitButton
Gets the exit menu button
Declaration
public RadMenuButtonItem ExitButton { get; }
Property Value
RadMenuButtonItem
|
ExpandButton
Gets or sets the ribbon expand/collapse button element.
Declaration
public RadToggleButtonElement ExpandButton { get; set; }
Property Value
RadToggleButtonElement
|
Expanded
Gets or sets a value indicating whether the RadRibbonBarElement is expanded or collapsed.
Declaration
public bool Expanded { get; set; }
Property Value
System.Boolean
|
HelpButton
Gets or sets the ribbon help button element.
Declaration
public RadImageButtonElement HelpButton { get; set; }
Property Value
RadImageButtonElement
|
IconPrimitive
Gets the icon primitive element used to display the application icon.
Declaration
public ImagePrimitive IconPrimitive { get; }
Property Value
ImagePrimitive
|
LayoutMode
Gets or sets the ribbon layout.
Declaration
[RadPropertyDefaultValue("LayoutMode", typeof(RadRibbonBarElement))]
public RibbonLayout LayoutMode { get; set; }
Property Value
RibbonLayout
|
LayoutModeButton
Gets or sets the ribbon layout mode button element.
Declaration
public RadToggleSwitchElement LayoutModeButton { get; set; }
Property Value
RadToggleSwitchElement
|
LayoutModeTextElement
Gets or sets the ribbon layout mode text element.
Declaration
public LightVisualElement LayoutModeTextElement { get; set; }
Property Value
LightVisualElement
|
LocalizationSettings
Gets or sets the localization settings for this ribbon bar element.
Declaration
public RibbonBarLocalizationSettings LocalizationSettings { get; }
Property Value
RibbonBarLocalizationSettings
|
MaximizeButton
Gets or sets a value indicating whether the maximize button is visible in the ribbon caption.
Declaration
public bool MaximizeButton { get; set; }
Property Value
System.Boolean
|
MDIbutton
MinimizeButton
Gets or sets a value indicating whether the minimize button is visible in the ribbon caption.
Declaration
public bool MinimizeButton { get; set; }
Property Value
System.Boolean
|
OptionsButton
Gets the options menu button
Declaration
public RadMenuButtonItem OptionsButton { get; }
Property Value
RadMenuButtonItem
|
Popup
Gets an instance of the RibbonBarPopup class which represents the ribbon bar popup.
Declaration
public RibbonBarPopup Popup { get; }
Property Value
RibbonBarPopup
|
QuickAccessMenuHeight
Gets or sets the height of the quick access.
Declaration
[RadPropertyDefaultValue("QuickAccessMenuHeight", typeof(RadRibbonBarElement))]
public int QuickAccessMenuHeight { get; set; }
Property Value
System.Int32
|
QuickAccessMenuItems
Gets the collection of quick access toolbar items.
Declaration
public RadItemOwnerCollection QuickAccessMenuItems { get; }
Property Value
RadItemOwnerCollection
|
QuickAccessToolBar
Gets the Quick Access Toolbar element.
Declaration
public RadQuickAccessToolBar QuickAccessToolBar { get; }
Property Value
RadQuickAccessToolBar
|
QuickAccessToolbarBelowRibbon
Gets or sets if the quick access toolbar is below the ribbon.
Declaration
[RadPropertyDefaultValue("QuickAccessToolbarBelowRibbon", typeof(RadRibbonBarElement))]
public bool QuickAccessToolbarBelowRibbon { get; set; }
Property Value
System.Boolean
|
RibbonCaption
Gets or sets the ribbon caption element.
Declaration
public RadRibbonBarCaption RibbonCaption { get; set; }
Property Value
RadRibbonBarCaption
|
SelectedCommandTab
Gets the instance of the currently selected command tab.
Declaration
public RibbonTab SelectedCommandTab { get; }
Property Value
RibbonTab
|
ShowExpandButton
Gets or sets a value indicating whether the expand button is visible or hidden.
Declaration
public bool ShowExpandButton { get; set; }
Property Value
System.Boolean
|
ShowHelpButton
Gets a value indicating whether the help button is visible or hidden.
Declaration
public bool ShowHelpButton { get; set; }
Property Value
System.Boolean
|
ShowLayoutModeButton
Gets or sets whether the toggle switch enabling the Simplified ribbon style is visible.
Declaration
[RadPropertyDefaultValue("ShowLayoutModeButton", typeof(RadRibbonBarElement))]
public bool ShowLayoutModeButton { get; set; }
Property Value
System.Boolean
|
SimplifiedHeight
Gets or sets the height of the simplified ribbon.
Declaration
[RadPropertyDefaultValue("SimplifiedHeight", typeof(RadRibbonBarElement))]
public int SimplifiedHeight { get; set; }
Property Value
System.Int32
|
StartButtonImage
Gets or sets the image of the start button placed in the top left corner.
Declaration
public Image StartButtonImage { get; set; }
Property Value
System.Drawing.Image
|
StartMenuBottomStrip
Gets the collection of start button menu items which appear at the bottom when the button has two columns.
Declaration
public RadItemOwnerCollection StartMenuBottomStrip { get; }
Property Value
RadItemOwnerCollection
|
StartMenuItems
Gets the collection of start button menu items.
Declaration
public RadItemOwnerCollection StartMenuItems { get; }
Property Value
RadItemOwnerCollection
|
StartMenuRightColumnItems
Gets the collection of start button menu items which appear on the right column.
Declaration
public RadItemOwnerCollection StartMenuRightColumnItems { get; }
Property Value
RadItemOwnerCollection
|
StartMenuWidth
Gets or sets the width of the start menu
Declaration
public int StartMenuWidth { get; set; }
Property Value
System.Int32
|
TabStripElement
Gets an instance of the RibbonTabStripElement which displays the tab items in the ribbon bar.
Declaration
public RibbonTabStripElement TabStripElement { get; }
Property Value
RibbonTabStripElement
|
Methods
ArrangeOverride(SizeF)
Arranges the child elements of the ribbon bar within the specified size.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
The final size for arranging the element. |
Returns
System.Drawing.SizeF
The actual size used for arranging the element. |
Overrides
ChangeTabBaseFillStyle(ContextualTabGroup, LightVisualElement, LightVisualElement)
Changes the base fill style for the tab based on the contextual group.
Declaration
protected virtual void ChangeTabBaseFillStyle(ContextualTabGroup group, LightVisualElement contentArea, LightVisualElement tabFill)
Parameters
ContextualTabGroup
group
The contextual tab group. |
LightVisualElement
contentArea
The content area element. |
LightVisualElement
tabFill
The tab fill element. |
Control_VisibleChanged(Object, EventArgs)
Handles the control's visible changed event.
Declaration
protected void Control_VisibleChanged(object sender, EventArgs e)
Parameters
System.Object
sender
The sender of the event. |
System.EventArgs
e
The event arguments. |
CreateChildElements()
Creates the child elements of the ribbon bar.
Declaration
protected override void CreateChildElements()
Overrides
CreateRibbonPopup()
Creates a new RibbonBarPopup instance.
Declaration
protected virtual RibbonBarPopup CreateRibbonPopup()
Returns
RibbonBarPopup
The created popup instance. |
DisposeManagedResources()
Releases managed resources used by the element.
Declaration
protected override void DisposeManagedResources()
Overrides
DoExpandCollapse()
Performs the core expand/collapse logic for the ribbon bar.
Declaration
protected virtual void DoExpandCollapse()
DpiScaleChanged(SizeF)
Handles DPI scale changes for the ribbon bar element.
Declaration
public override void DpiScaleChanged(SizeF scaleFactor)
Parameters
System.Drawing.SizeF
scaleFactor
The new scale factor. |
Overrides
GetMaximumRibbonGroupMargin(ExpandableStackLayout)
Gets the maximum margin from ribbon groups in the specified holder.
Declaration
protected virtual float GetMaximumRibbonGroupMargin(ExpandableStackLayout groupsHolder)
Parameters
ExpandableStackLayout
groupsHolder
The expandable stack layout containing the groups. |
Returns
System.Single
The maximum margin value. |
GetMaximumTabContentHeight()
Gets the maximum height of tab content across all command tabs.
Declaration
protected virtual float GetMaximumTabContentHeight()
Returns
System.Single
The maximum tab content height. |
GetMaximumTabStripHeight()
Gets the maximum height of the tab strip including content.
Declaration
protected virtual float GetMaximumTabStripHeight()
Returns
System.Single
The maximum tab strip height. |
InitializeFields()
Initializes the fields used by the ribbon bar element.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the ribbon bar element and returns the desired size.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
The available size for the element. |
Returns
System.Drawing.SizeF
The desired size of the element. |
Overrides
OnApplicationMenuStyleChanged(EventArgs)
Raises the ApplicationMenuStyleChanged event.
Declaration
protected virtual void OnApplicationMenuStyleChanged(EventArgs args)
Parameters
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnBubbleEvent(RadElement, RoutedEventArgs)
Handles bubble events from child elements.
Declaration
protected override void OnBubbleEvent(RadElement sender, RoutedEventArgs args)
Parameters
RadElement
sender
The element that raised the event. |
RoutedEventArgs
args
The routed event arguments. |
Overrides
OnCommandTabCollapsed(CommandTabEventArgs)
Raises the CommandTabCollapsed event.
Declaration
protected virtual void OnCommandTabCollapsed(CommandTabEventArgs args)
Parameters
CommandTabEventArgs
args
A CommandTabEventArgs that contains the event data. |
OnCommandTabExpanded(CommandTabEventArgs)
Raises the CommandTabExpanded event.
Declaration
protected virtual void OnCommandTabExpanded(CommandTabEventArgs args)
Parameters
CommandTabEventArgs
args
A CommandTabEventArgs that contains the event data. |
OnCommandTabSelected(CommandTabEventArgs)
Raises the CommandTabSelected event.
Declaration
protected virtual void OnCommandTabSelected(CommandTabEventArgs args)
Parameters
CommandTabEventArgs
args
A CommandTabEventArgs that contains the event data. |
OnCommandTabSelecting(CommandTabSelectingEventArgs)
Raises the CommandTabSelecting event.
Declaration
protected virtual void OnCommandTabSelecting(CommandTabSelectingEventArgs args)
Parameters
CommandTabSelectingEventArgs
args
A CommandTabSelectingEventArgs that contains the event data. |
OnItemStyleChanged(Object, ItemStyleChangedEventArgs)
Raises the ItemStyleChanged event.
Declaration
protected virtual void OnItemStyleChanged(object sender, ItemStyleChangedEventArgs args)
Parameters
System.Object
sender
The group where the item is located. |
ItemStyleChangedEventArgs
args
An ItemStyleChangedEventArgs that contains the event data. |
OnItemStyleChanging(Object, ItemStyleChangingEventArgs)
Raises the ItemStyleChanging event.
Declaration
protected virtual void OnItemStyleChanging(object sender, ItemStyleChangingEventArgs args)
Parameters
System.Object
sender
The group where the item is located. |
ItemStyleChangingEventArgs
args
An ItemStyleChangingEventArgs that contains the event data. |
OnItemVisiblityStateChanging(Object, ItemVisiblityStateChangingEventArgs)
Raises the ItemVisiblityStateChanging event.
Declaration
protected virtual void OnItemVisiblityStateChanging(object sender, ItemVisiblityStateChangingEventArgs args)
Parameters
System.Object
sender
The item which is about to be changed. |
ItemVisiblityStateChangingEventArgs
args
An ItemVisiblityStateChangingEventArgs that contains the event data. |
OnLayoutModeChanged(EventArgs)
Raises the LayoutModeChanged event.
Declaration
protected virtual void OnLayoutModeChanged(EventArgs args)
Parameters
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnLoaded()
Called when the element is loaded into the element tree.
Declaration
protected override void OnLoaded()
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property changes for the ribbon bar element.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
The property changed event arguments. |
Overrides
OnRibbonBarExpandedStateChanged(EventArgs)
Raises the ExpandedStateChanged event.
Declaration
protected virtual void OnRibbonBarExpandedStateChanged(EventArgs args)
Parameters
System.EventArgs
args
An System.EventArgs instance that contains the event data. |
OnShowRibbonLayoutButtonChanged()
Called when the show ribbon layout button property changes.
Declaration
protected virtual void OnShowRibbonLayoutButtonChanged()
OnSimplifiedRibbonHeightChanged()
Called when the simplified ribbon height property changes.
Declaration
protected virtual void OnSimplifiedRibbonHeightChanged()
PaintOverride(IGraphics, Rectangle, Single, SizeF, Boolean)
Paints the ribbon bar element.
Declaration
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
Parameters
IGraphics
screenRadGraphics
The graphics object used for painting. |
System.Drawing.Rectangle
clipRectangle
The clipping rectangle. |
System.Single
angle
The rotation angle. |
System.Drawing.SizeF
scale
The scale factor. |
System.Boolean
useRelativeTransformation
Whether to use relative transformation. |
Overrides
PerformExpandedCore()
Performs the core logic for expanding or collapsing the ribbon bar.
Declaration
protected virtual void PerformExpandedCore()
ShowPopup(RadPageViewItem)
Shows a popup for the specified page view item.
Declaration
public void ShowPopup(RadPageViewItem item)
Parameters
RadPageViewItem
item
The page view item to show popup for. |
UpdateReferences(ComponentThemableElementTree, Boolean, Boolean)
Updates references when the element tree changes.
Declaration
protected override void UpdateReferences(ComponentThemableElementTree tree, bool updateInheritance, bool recursive)
Parameters
ComponentThemableElementTree
tree
The new component tree. |
System.Boolean
updateInheritance
Whether to update inheritance. |
System.Boolean
recursive
Whether to update recursively. |
Overrides
Events
ApplicationMenuStyleChanged
Occurs when the application menu style is changed.
Declaration
public event EventHandler ApplicationMenuStyleChanged
Event Type
System.EventHandler
|
CommandTabCollapsed
Occurs when a command tab is collapsed by double clicking an expanded command tab item.
Declaration
public event CommandTabEventHandler CommandTabCollapsed
Event Type
CommandTabEventHandler
|
CommandTabExpanded
Occurs when a command tab is expanded by double clicking a collapsed command tab item.
Declaration
public event CommandTabEventHandler CommandTabExpanded
Event Type
CommandTabEventHandler
|
CommandTabSelected
Occurs when a command tab is selected.
Declaration
public event CommandTabEventHandler CommandTabSelected
Event Type
CommandTabEventHandler
|
CommandTabSelecting
Occurs just before a command tab is selected.
Declaration
public event CommandTabSelectingEventHandler CommandTabSelecting
Event Type
CommandTabSelectingEventHandler
|
ExpandedStateChanged
Occurs when the ribbon bar is either expanded or collapsed.
Declaration
public event EventHandler ExpandedStateChanged
Event Type
System.EventHandler
|
ItemStyleChanged
Occurs after a RadProperty has changed after changing the layout mode.
Declaration
public event ItemStyleChangedEventHandler ItemStyleChanged
Event Type
ItemStyleChangedEventHandler
|
ItemStyleChanging
Occurs when a RadProperty is about to be changed after changing the layout mode.
Declaration
public event ItemStyleChangingEventHandler ItemStyleChanging
Event Type
ItemStyleChangingEventHandler
|
ItemVisiblityStateChanging
Occurs when an item's visibility state is about to be changed while resizing the ribbon bar.
Declaration
public event ItemVisiblityStateChangingEventHandler ItemVisiblityStateChanging
Event Type
ItemVisiblityStateChangingEventHandler
|
LayoutModeChanged
Occurs when the layout mode is changed between Default and Simplified.
Declaration
public event EventHandler LayoutModeChanged
Event Type
System.EventHandler
|