Class RibbonGallery
Represents a RibbonGallery control.
Inherited Members
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class RibbonGallery : RibbonItemsControl, ICollapsable, IRibbonControl, IDisposable
Remarks
RibbonGallery class represents a gallery control that can display collection of UIElements in inline of popup control.
Examples
This example shows how to create a RibbonGallery in XAML.
<ribbon:RibbonGallery Margin="3" VisualMode="DropDown" SizeForm="Large" Label="The gallery" LargeIcon="/SampleImages/SchemeBlack.png" ExpandWidth="270" ItemWidth="80">
<ribbon:RibbonGalleryItem>
<Border ClipToBounds="True">
<TextBlock>TrueItem</TextBlock>
</Border>
</ribbon:RibbonGalleryItem>
<TextBlock>Test</TextBlock>
<Image Source="SampleImages/Apex.png"/>
<Image Source="SampleImages/Aspect.png"/>
</ribbon:RibbonGallery
This example shows how to create a RibbonGallery in C#.
RibbonGallery gallery = new RibbonGallery();
TextBlock text = new TextBlock();
text.Text = "Item";
gallery.Items.Add(text);
Constructors
RibbonGallery()
Initializes a new instance of the RibbonGallery class.
Declaration
public RibbonGallery()
Fields
CurrentFilterProperty
Defines current gallery filter. This is a dependency property.
Declaration
public static readonly DependencyProperty CurrentFilterProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ExpandHeightProperty
Defines the expand height of the popup gallery. This is a dependency property.
Declaration
public static readonly DependencyProperty ExpandHeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ExpandWidthProperty
Defines the expand width of the popup gallery. This is a dependency property.
Declaration
public static readonly DependencyProperty ExpandWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
FilterIndexesProperty
Defines gallery filter indexes. This is a dependency property.
Declaration
public static readonly DependencyProperty FilterIndexesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
GalleryFiltersProperty
Defines the collection of gallery filters. This is a dependency property.
Declaration
public static readonly DependencyProperty GalleryFiltersProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
GalleryGroupsProperty
Defines collection of ribbon gallery groups. This is a dependency property.
Declaration
public static readonly DependencyProperty GalleryGroupsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HasFiltersProperty
Defines whether gallery control has gallery filters. This is a dependency property.
Declaration
public static readonly DependencyProperty HasFiltersProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HasFiltersPropertyKey
Defines whether gallery control has gallery filters. This is a dependency property key.
Declaration
protected static readonly DependencyPropertyKey HasFiltersPropertyKey
Field Value
| Type |
|---|
| System.Windows.DependencyPropertyKey |
HasGroupsProperty
Defines whether the gallery has groups. This is a dependency property.
Declaration
public static readonly DependencyProperty HasGroupsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HasGroupsPropertyKey
Defines whether the gallery has groups. This is a dependency property key.
Declaration
protected static readonly DependencyPropertyKey HasGroupsPropertyKey
Field Value
| Type |
|---|
| System.Windows.DependencyPropertyKey |
ItemHeightProperty
Defines the gallery item height. This is a dependency property.
Declaration
public static readonly DependencyProperty ItemHeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ItemMouseOverBorderCornerRadiusProperty
Defines the gallery item mouse over border corner radius. This is a dependency property.
Declaration
public static readonly DependencyProperty ItemMouseOverBorderCornerRadiusProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ItemMouseOverBorderThicknessProperty
Defines the gallery item mouse over border thickness. This is a dependency property.
Declaration
public static readonly DependencyProperty ItemMouseOverBorderThicknessProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ItemWidthProperty
Defines the gallery item width. This is a dependency property.
Declaration
public static readonly DependencyProperty ItemWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MenuIconBarEnabledProperty
Defines whether menu icon bar is enabled. This is a dependency property.
Declaration
public static readonly DependencyProperty MenuIconBarEnabledProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MenuItemsProperty
Defines the collection of gallery menu items. This is a dependency property.
Declaration
public static readonly DependencyProperty MenuItemsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PopupPositionProperty
Defines the the popup position. This is a dependency property.
Declaration
public static readonly DependencyProperty PopupPositionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PopupPositionPropertyKey
Defines the the popup position. This is a dependency property key.
Declaration
protected static readonly DependencyPropertyKey PopupPositionPropertyKey
Field Value
| Type |
|---|
| System.Windows.DependencyPropertyKey |
ResizeDirectionProperty
Defines resize direction of the popup gallery. This is a dependency property.
Declaration
public static readonly DependencyProperty ResizeDirectionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectedItemProperty
Defines the selected gallery item. This is a dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
VisualModeProperty
Defines the gallery visual mode. This is a dependency property.
Declaration
public static readonly DependencyProperty VisualModeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
CurrentFilter
Gets the current filter.
Declaration
public RibbonGalleryFilter CurrentFilter { get; }
Property Value
| Type | Description |
|---|---|
| RibbonGalleryFilter | The current filter. |
ExpandHeight
Gets or sets the height of the expand.
Declaration
public double ExpandHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The height of the expand. |
ExpandWidth
Gets or sets the width of the expand.
Declaration
public double ExpandWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The width of the expand. |
GalleryFilters
Gets or sets the gallery filters.
Declaration
public ObservableCollection<RibbonGalleryFilter> GalleryFilters { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<RibbonGalleryFilter> | The gallery filters. |
GalleryGroups
Gets or sets the gallery groups.
Declaration
public ObservableCollection<RibbonGalleryGroup> GalleryGroups { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<RibbonGalleryGroup> | The gallery groups. |
HasFilters
Gets or sets a value indicating whether this instance has filters.
Declaration
public bool HasFilters { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
HasGroups
Gets or sets a value indicating whether this instance has groups.
Declaration
public bool HasGroups { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
ItemHeight
Gets or sets the height of the item.
Declaration
public int ItemHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The height of the item. |
ItemMouseOverBorderCornerRadius
Gets or sets the corner radius for item mouse over border.
Declaration
public CornerRadius ItemMouseOverBorderCornerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.CornerRadius | The visual mode. |
ItemMouseOverBorderThickness
Gets or sets the thickness for item mouse over border.
Declaration
public double ItemMouseOverBorderThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The visual mode. |
ItemWidth
Gets or sets the width of the item.
Declaration
public int ItemWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The width of the item. |
MenuIconBarEnabled
Gets or sets a value indicating whether [menu icon bar enabled].
Declaration
public bool MenuIconBarEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
MenuItems
Gets or sets the menu items.
Declaration
public ObservableCollection<object> MenuItems { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<System.Object> | The menu items. |
PopupPosition
Gets or sets the popup position.
Declaration
public PopupPosition PopupPosition { get; protected set; }
Property Value
| Type | Description |
|---|---|
| PopupPosition | The popup position. |
ResizeDirection
Gets or sets the resize direction.
Declaration
public ResizeDirection ResizeDirection { get; set; }
Property Value
| Type | Description |
|---|---|
| ResizeDirection | The resize direction. |
SelectedItem
Gets or sets the selected item.
Declaration
public object SelectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The selected item. |
VisualMode
Gets or sets the visual mode.
Declaration
public RibbonGalleryVisualMode VisualMode { get; set; }
Property Value
| Type | Description |
|---|---|
| RibbonGalleryVisualMode | The visual mode. |
Methods
Dispose()
Disposes the unmanaged resources of RibbonGallery.
Declaration
public void Dispose()
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
| Type | Description |
|---|---|
| System.Windows.DependencyObject | Return RibbonGalleryItem |
GetFilterIndexes(DependencyObject)
Gets the value of the FilterIndexes property for a given element.
Declaration
public static Int32Collection GetFilterIndexes(DependencyObject obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | obj | The element for which to retrieve the FilterIndexes value. |
Returns
| Type | Description |
|---|---|
| System.Windows.Media.Int32Collection | The Filter Index property |
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is (or is eligible to be) its own container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item | The item to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the item is (or is eligible to be) its own container; otherwise, false. |
OnApplyTemplate()
Called when ApplyTemplate is called.
Declaration
public override void OnApplyTemplate()
Overrides
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
| Type | Description |
|---|---|
| System.Windows.Automation.Peers.AutomationPeer | The type-specific AutomationPeer implementation. |
OnCurrentFilterChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises CurrentFilterChanged event.
Declaration
protected virtual void OnCurrentFilterChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnExpandHeightChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises ExpandHeightChanged event.
Declaration
protected virtual void OnExpandHeightChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnExpandWidthChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises ExpandWidthChanged event.
Declaration
protected virtual void OnExpandWidthChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnHasFiltersChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises HasFiltersChanged event.
Declaration
protected virtual void OnHasFiltersChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnHasGroupsChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises HasGroupsChanged event.
Declaration
protected virtual void OnHasGroupsChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs)
Declaration
protected override void OnIsDropDownOpenChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e |
Overrides
OnItemHeightChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises ItemHeightChanged event.
Declaration
protected virtual void OnItemHeightChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Called when Items collection is changed.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Specialized.NotifyCollectionChangedEventArgs | e |
OnItemWidthChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises ItemWidthChanged event.
Declaration
protected virtual void OnItemWidthChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
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. |
Overrides
OnMouseLeftButtonUp(MouseButtonEventArgs)
Provides class handling for the MouseLeftButtonUp routed event that occurs when the left mouse button is released while the mouse pointer is over this control. Invoked when an unhandled System.Windows.UIElement.MouseLeftButtonUprouted 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 OnMouseLeftButtonUp(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 left mouse button was released. |
Overrides
OnMouseRightButtonUp(MouseButtonEventArgs)
Provides class handling for the MouseRightButtonUp routed event that occurs when the Right mouse button is released while the mouse pointer is over this control.
Declaration
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e |
Overrides
OnPopupPositionChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises PopupPositionChanged event.
Declaration
protected virtual void OnPopupPositionChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnPreviewKeyDown(KeyEventArgs)
Raises the PreviewKeyDown event.
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | The event data |
Overrides
OnPreviewMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseLeftButtonUp 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 OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was released. |
OnPreviewTouchUp(TouchEventArgs)
Provides class handling for the PreviewTouchUp routed event that occurs when a touch is released inside this element.
Declaration
protected override void OnPreviewTouchUp(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e | The event data |
OnResizeDirectionChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises ResizeDirectionChanged event.
Declaration
protected virtual void OnResizeDirectionChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnSelectedItemChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises SelectedItemChanged event.
Declaration
protected virtual void OnSelectedItemChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
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 |
Overrides
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 |
Overrides
OnVisualModeChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises VisualModeChanged event.
Declaration
protected virtual void OnVisualModeChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
Popup_Closed(Object, EventArgs)
Handles the Closed event of the Popup control.
Declaration
protected override void Popup_Closed(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The source of the event. |
| System.EventArgs | e | The System.EventArgs instance containing the event data. |
Overrides
Popup_Opened(Object, EventArgs)
Occurs when the IsOpen property changes to true.
Declaration
protected override void Popup_Opened(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The sender |
| System.EventArgs | e | The event data |
Overrides
SetFilterIndexes(DependencyObject, Int32Collection)
Sets the value of the FilterIndexes property for a given element.
Declaration
public static void SetFilterIndexes(DependencyObject obj, Int32Collection value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | obj | The element on which to apply the property value. |
| System.Windows.Media.Int32Collection | value | FilterIndexes value |
Events
CurrentFilterChanged
Event that is raised when CurrentFilter property is changed.
Declaration
public event PropertyChangedCallback CurrentFilterChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
ExpandHeightChanged
Event that is raised when ExpandHeight property is changed.
Declaration
public event PropertyChangedCallback ExpandHeightChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
ExpandWidthChanged
Event that is raised when ExpandWidth property is changed.
Declaration
public event PropertyChangedCallback ExpandWidthChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
HasFiltersChanged
Event that is raised when HasFilters property is changed.
Declaration
public event PropertyChangedCallback HasFiltersChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
HasGroupsChanged
Event that is raised when HasGroups property is changed.
Declaration
public event PropertyChangedCallback HasGroupsChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
ItemHeightChanged
Event that is raised when ItemHeight property is changed.
Declaration
public event PropertyChangedCallback ItemHeightChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
ItemWidthChanged
Event that is raised when ItemWidth property is changed.
Declaration
public event PropertyChangedCallback ItemWidthChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
PopupPositionChanged
Event that is raised when PopupPosition property is changed.
Declaration
public event PropertyChangedCallback PopupPositionChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
ResizeDirectionChanged
Event that is raised when ResizeDirection property is changed.
Declaration
public event PropertyChangedCallback ResizeDirectionChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
SelectedItemChanged
Event that is raised when SelectedItem property is changed.
Declaration
public event PropertyChangedCallback SelectedItemChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
VisualModeChanged
Event that is raised when VisualMode property is changed.
Declaration
public event PropertyChangedCallback VisualModeChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |