Class RibbonBar
Represents a RibbonBar control.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class RibbonBar : ItemsControl, IRibbonControl, IDisposable
Remarks
Represents a Ribbon Bar control that appears within a RibbonTab and hosts buttons and other controls.
Examples
This example shows how to create a RibbonBar in XAML.
<ribbon:RibbonBar Header="Pages">
<ribbon:DropDownButton Label="Cover Page" SizeForm="Large" LargeIcon="SampleImages/CoverPage32.png"/>
<ribbon:RibbonButton Label="BlankPage" SizeForm="Large" LargeIcon="SampleImages/BlankPage32.png"/>
<ribbon:RibbonButton Label="PageBreak" SizeForm="Large" LargeIcon="SampleImages/PageBreak32.png"/>
</ribbon:RibbonBar>
This example shows how to create a RibbonBar in C#.
RibbonTab tab;
RibbonButton button1;
RibbonButton button2;
RibbonBar bar = new RibbonBar();
bar.Items.Add(button1);
bar.Items.Add(button2);
tab.Items.Add( bar );
Constructors
RibbonBar()
Initializes a new instance of the RibbonBar class.
Declaration
public RibbonBar()
Fields
CollapseImageProperty
Gets or sets the value of the ImageSource which will be shown, when RibbonBar is collapsed. This is a dependency property.
Declaration
public static readonly DependencyProperty CollapseImageProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderProperty
Gets or sets Header of the RibbonBar. This is a dependency property.
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconTemplateProperty
Identifies the IconTemplate dependency property.
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IconTemplate dependency property.
IsLargeButtonPanelProperty
Gets or sets value that indicates type of layout. This is a dependency property.
Declaration
public static readonly DependencyProperty IsLargeButtonPanelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsLauncherButtonVisibleProperty
Get/sets whether LauncherButton is visible. This is a dependency property.
Declaration
public static readonly DependencyProperty IsLauncherButtonVisibleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsPanelStateCollapsedProperty
Identifies the IsPanelStateCollapsed dependency property.
Declaration
public static readonly DependencyProperty IsPanelStateCollapsedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IsPanelStateCollapsed dependency property.
IsRibbonGalleryPresentProperty
Get/sets whether RibbonGallery is present in RibbonBar. This is a dependency property.
Declaration
public static readonly DependencyProperty IsRibbonGalleryPresentProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
KeyTipOnCollapsedProperty
Identifies the KeyTipOnCollapsed dependency property.
Declaration
public static readonly DependencyProperty KeyTipOnCollapsedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the KeyTipOnCollapsed dependency property.
LauncherClickEvent
Identifies the Click routed event.
Declaration
public static RoutedEvent LauncherClickEvent
Field Value
Type | Description |
---|---|
System.Windows.RoutedEvent | Type: System.Windows.RoutedEvent The identifier for the Launcher button Click routed event. |
Remarks
This event corresponds to a left mouse Launcher button click.
LauncherCommandParameterProperty
Represents the launcher command parameter, This is a Dependency Property
Declaration
public static readonly DependencyProperty LauncherCommandParameterProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LauncherCommandProperty
Represents the Launcher command, This is a Dependency Property
Declaration
public static readonly DependencyProperty LauncherCommandProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LauncherCommandTargetProperty
Represents the Launcher command target, This is a Dependency Property
Declaration
public static readonly DependencyProperty LauncherCommandTargetProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LauncherToolTipProperty
Get / sets the LauncherButton tooltip object. This is a dependency property.
Declaration
public static readonly DependencyProperty LauncherToolTipProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
m_DesiredSize
Desired size of RibbonBar, this value is setting before collapsing.
Declaration
public Size m_DesiredSize
Field Value
Type |
---|
System.Windows.Size |
PanelStateProperty
Defines state of the panel. This is a dependency property.
Declaration
public static readonly DependencyProperty PanelStateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
PanelStatePropertyKey
Defines state of the panel for read-only purposes. This is a dependency property key.
Declaration
protected static readonly DependencyPropertyKey PanelStatePropertyKey
Field Value
Type |
---|
System.Windows.DependencyPropertyKey |
PositionProperty
Identifies the Position dependency property.
Declaration
public static readonly DependencyProperty PositionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Position dependency property.
ShowInMoreCommandsProperty
Gets or sets a value indicating whether [show in more commands].
Declaration
public static readonly DependencyProperty ShowInMoreCommandsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
CollapseImage
Gets or sets the image that appears in a when RibbonBar is collapsed.
Declaration
public ImageSource CollapseImage { get; set; }
Property Value
Type |
---|
System.Windows.Media.ImageSource |
Examples
// Create the image element.
RibbonBar bar = new RibbonBar();
// Create source.
BitmapImage bimage = new BitmapImage();
// BitmapImage.UriSource must be in a BeginInit/EndInit block.
bimage.BeginInit();
bimage.UriSource = new Uri(@"/sampleImages/sample.jpg",UriKind.RelativeOrAbsolute);
bimage.EndInit();
// Set the image source.
bar.CollapseImage = bimage;
See Also
Header
Gets or sets the text that headers the RibbonBar.
Declaration
public string Header { get; set; }
Property Value
Type | Description |
---|---|
System.String | Type: System.String Text that headers the RibbonBar. The default is "RibbonBar" string. |
Examples
RibbonBar bar = new RibbonBar();
bar.Header = "Buttons Bar";
See Also
IconTemplate
Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
IsLargeButtonPanel
Gets or sets a value indicating whether the type of layout.
Declaration
public bool IsLargeButtonPanel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type: System.Boolean True if the layout of RibbonBar controls should arrange large controls; false is controls should be arranged in two rows. |
Remarks
Default value it true.
Examples
RibbonBar bar;
// ......
bar.IsLargeButtonPanel = false;
IsLauncherButtonVisible
Gets or sets a value indicating whether this instance is launcher button visible.
Declaration
public bool IsLauncherButtonVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsPanelStateCollapsed
Declaration
public bool IsPanelStateCollapsed { get; set; }
Property Value
Type |
---|
System.Boolean |
IsRibbonGalleryPresent
Gets or sets a value indicating whether this instance is ribbon gallery present.
Declaration
public bool IsRibbonGalleryPresent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
KeyTipOnCollapsed
Gets or sets check the KeyTip collapsed or not.
Declaration
public string KeyTipOnCollapsed { get; set; }
Property Value
Type |
---|
System.String |
LauncherButton
Gets the Launcher button of the RibbonBar.
Declaration
public RibbonButton LauncherButton { get; }
Property Value
Type | Description |
---|---|
RibbonButton | Type: RibbonButton RibbonButton that appears in header of the RibbonBar. |
Examples
RibbonBar bar = new RibbonBar();
RibbonButton launcher = bar.LauncherButton;
launcher.Visibility = Visibility.Hidden;
See Also
LauncherToolTip
Gets or sets the launcher tool tip. LauncherButton control.
Declaration
public object LauncherToolTip { get; set; }
Property Value
Type | Description |
---|---|
System.Object | Type: System.Object Object that represents LauncherButton tooltip. |
Examples
RibbonBar bar;
// ......
bar.LauncherToolTip = "Tooltip text";
See Also
PanelState
Gets or sets a value that indicates state of the RibbonBar.
Declaration
public RibbonBarState PanelState { get; protected set; }
Property Value
Type | Description |
---|---|
RibbonBarState | Type: RibbonBarState TwoRow if controls should be arranged in two rows. Collapsed if large collapse image should be displayed. Extra Small if RibbonBar is collapsed in extra small size. |
Remarks
Default value it TwoRow.
Examples
RibbonBar bar;
// ......
RibbonBarState state = bar.PanelState;
See Also
Position
Declaration
public HorizontalPosition Position { get; set; }
Property Value
Type | Description |
---|---|
HorizontalPosition | When Position is set to Right, then it will be placed at right side of the RibbonTab. Otherwise RibbonBar will be placed at left side of the RibbonTab. The default value is Left. |
ShowInMoreCommands
Gets or sets a value indicating whether [show in more commands].
Declaration
public bool ShowInMoreCommands { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
AddItem(IRibbonControl, RibbonDynamicItemInfo)
Declaration
public void AddItem(IRibbonControl item, RibbonDynamicItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
IRibbonControl | item | |
RibbonDynamicItemInfo | info |
Dispose()
Declaration
public void Dispose()
GetLauncherCommand(DependencyObject)
Gets the launcher command.
Declaration
public static ICommand GetLauncherCommand(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
Returns
Type |
---|
System.Windows.Input.ICommand |
GetLauncherCommandParameter(DependencyObject)
Gets the launcher command parameter.
Declaration
public static object GetLauncherCommandParameter(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
Returns
Type | Description |
---|---|
System.Object | The command |
GetLauncherCommandTarget(DependencyObject)
Gets the launcher command target.
Declaration
public static IInputElement GetLauncherCommandTarget(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
Returns
Type | Description |
---|---|
System.Windows.IInputElement | The value |
HidePopup()
Hide the popup of the RibbonBar if it is collapsed.
Declaration
public void HidePopup()
OnApplyTemplate()
This method will be invoked whenever application code or internal processes call ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnCollapseImageChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises CollapseImageChanged event.
Declaration
protected virtual void OnCollapseImageChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
System.Windows.Automation.Peers.AutomationPeer | The type-specific AutomationPeer implementation. |
OnHeaderChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises HeaderChanged event.
Declaration
protected virtual void OnHeaderChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnInitialized(EventArgs)
Invoked when control is initialized.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Information about the event. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Invoked when the Items property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The event data |
OnItemsPanelChanged(ItemsPanelTemplate, ItemsPanelTemplate)
Declaration
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.ItemsPanelTemplate | oldItemsPanel | |
System.Windows.Controls.ItemsPanelTemplate | newItemsPanel |
OnKeyDown(KeyEventArgs)
Invoked when the System.Windows.UIElement.KeyDown event is received.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e | Information about the event. |
OnKeyTipOnCollapsedChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises PanelStateChanged event.
Declaration
protected virtual void OnKeyTipOnCollapsedChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnMouseRightButtonUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseRightButtonUp�routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released. |
OnPanelStateChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises PanelStateChanged event.
Declaration
protected virtual void OnPanelStateChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnRenderSizeChanged(SizeChangedInfo)
Occurs when the control size is changed.
Declaration
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.SizeChangedInfo | sizeInfo | Details of the old and new size involved in the change. |
OnStylusSystemGesture(StylusSystemGestureEventArgs)
Invoked when an unhandled Stylus.StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.StylusSystemGestureEventArgs | e | The event data |
OnTouchUp(TouchEventArgs)
Provides class handling for the TouchUp routed event that occurs when a touch is released inside this element.
Declaration
protected override void OnTouchUp(TouchEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.TouchEventArgs | e | The event data |
SetLauncherCommand(DependencyObject, ICommand)
Sets the launcher command.
Declaration
public static void SetLauncherCommand(DependencyObject obj, ICommand value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
System.Windows.Input.ICommand | value | The value. |
SetLauncherCommandParameter(DependencyObject, Object)
Sets the launcher command parameter.
Declaration
public static void SetLauncherCommandParameter(DependencyObject obj, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
System.Object | value | Th command |
SetLauncherCommandTarget(DependencyObject, IInputElement)
Sets the launcher command target.
Declaration
public static void SetLauncherCommandTarget(DependencyObject obj, IInputElement value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | The obj. |
System.Windows.IInputElement | value | The value. |
ShowPopup()
Show the popup of the RibbonBar if it is collapsed.
Declaration
public void ShowPopup()
Events
CollapseImageChanged
Event that is raised when CollapseImage property is changed.
Declaration
public event PropertyChangedCallback CollapseImageChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
HeaderChanged
Event that is raised when Header property is changed.
Declaration
public event PropertyChangedCallback HeaderChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
LauncherClick
Event that is raised when LauncherButton is clicked.
Declaration
public event RoutedEventHandler LauncherClick
Event Type
Type |
---|
System.Windows.RoutedEventHandler |
PanelStateChanged
Event that is raised when PanelState property is changed.
Declaration
public event PropertyChangedCallback PanelStateChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
Explicit Interface Implementations
IRibbonControl.get_ToolTip()
Declaration
object IRibbonControl.get_ToolTip()
Returns
Type |
---|
System.Object |
IRibbonControl.Label
Gets the value of the Label property.
Declaration
string IRibbonControl.Label { get; }
Returns
Type |
---|
System.String |
IRibbonControl.SmallIcon
Gets the value of the Image property.
Declaration
ImageSource IRibbonControl.SmallIcon { get; }
Returns
Type |
---|
System.Windows.Media.ImageSource |