ContextToolbarControl Class
A RibbonToolbarControl context panel.
Namespace: DevExpress.WinUI.Ribbon
Assembly: DevExpress.WinUI.Ribbon.v21.1.dll
Declaration
[ContentProperty(Name = "Group")]
[TemplatePart(Name = "PART_Flyout", Type = typeof(NestedMenuFlyoutControl))]
public class ContextToolbarControl :
ControlEx,
ISupportFlyoutNavigation,
ISupportKeyNavigation,
IContextMenu,
IContextMenuBase,
ISupportContextMenuEvents,
IVisualItem
Remarks
The Context Panel is a panel that is displayed when a user opens a RibbonToolbarControl content’s context menu.
You can add the following items to the Context Panel:
- Regular Context Toolbar Button
- Context Toolbar Combo Box
- Context Toolbar Menu Button
- Context Toolbar Radio Button
- Context Toolbar Split Button
- Context Toolbar Toggle Button
You should specify the Target property to bind the context menu with the RibbonToolbarControl’s content.
The following code sample displays a ContextToolbarControl with a ContextToolbarMenuButton and three ContextToolbarButtons in a RibbonToolbarControl:
<Ribbon:RibbonToolbarControl Width="400">
<Ribbon:RibbonToolbarTab Caption="Page Layout" >
<Ribbon:RibbonToolbarGroup Caption="Sheet Options">
<Ribbon:RibbonToolbarButton Content="Button" />
</Ribbon:RibbonToolbarGroup>
</Ribbon:RibbonToolbarTab>
<Ribbon:RibbonToolbarControl.Content>
<StackPanel x:Name="Content">
<Ribbon:ContextToolbarControl Target="{Binding ElementName=Content}" Orientation="Vertical">
<Ribbon:ContextToolbarGroup>
<Ribbon:ContextToolbarMenuButton Content="Pictures" ItemStyle="Glyph" Orientation="Vertical">
<Ribbon:ContextToolbarMenuButton.Icon>
<SymbolIcon Symbol="Pictures"/>
</Ribbon:ContextToolbarMenuButton.Icon>
<Ribbon:ContextToolbarButton Content="This Device..." >
<Ribbon:ContextToolbarButton.Icon>
<SymbolIcon Symbol="Folder"/>
</Ribbon:ContextToolbarButton.Icon>
</Ribbon:ContextToolbarButton>
<Ribbon:ContextToolbarButton Content="Stock Images...">
<Ribbon:ContextToolbarButton.Icon>
<SymbolIcon Symbol="BrowsePhotos"/>
</Ribbon:ContextToolbarButton.Icon>
</Ribbon:ContextToolbarButton>
<Ribbon:ContextToolbarButton Content="Online Pictures..." >
<Ribbon:ContextToolbarButton.Icon>
<SymbolIcon Symbol="Globe"/>
</Ribbon:ContextToolbarButton.Icon>
</Ribbon:ContextToolbarButton>
</Ribbon:ContextToolbarMenuButton>
<Ribbon:ContextToolbarButton Content="Cut"/>
<Ribbon:ContextToolbarButton Content="Copy"/>
<Ribbon:ContextToolbarButton Content="Paste"/>
</Ribbon:ContextToolbarGroup>
</Ribbon:ContextToolbarControl>
<Button Width="400" Height="100" />
</StackPanel>
</Ribbon:RibbonToolbarControl.Content>
</Ribbon:RibbonToolbarControl>
Inheritance
Object
DependencyObject
UIElement
FrameworkElement
Control
DevExpress.WinUI.Controls.Core.Internal.ControlEx
ContextToolbarControl
See Also