Class ApplicationMenu
Represents a ApplicationMenu control.
Inheritance
Implements
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class ApplicationMenu : HeaderedItemsControl, IDisposable
Remarks
ApplicationMenu class represents a Ribbon menu popup control that can be displayed above the Ribbon.
Examples
This example shows how to create a ApplicationMenu in XAML.
<ribbon:ApplicationMenu ApplicationButtonImage="/SampleImages/superman.ico" >
<ribbon:ApplicationMenu.MenuItems>
<TextBlock MinWidth="300" FontWeight="Bold">Recent Documents</TextBlock>
<Separator Padding="0"/>
</ribbon:ApplicationMenu.MenuItems>
<ribbon:ApplicationMenu.ApplicationItems>
<ribbon:ButtonPanel Margin="5,0,5,0">
<ribbon:RibbonButton SizeForm = "Small" Label="Options" SmallIcon="SampleImages/Options.png"/>
</ribbon:ButtonPanel>
<ribbon:ButtonPanel>
<ribbon:RibbonButton SizeForm = "Small" Label="Exit" Command="ApplicationCommands.Close" SmallIcon="SampleImages/Exit.png"/>
</ribbon:ButtonPanel>
</ribbon:ApplicationMenu.ApplicationItems>
<ribbon:SimpleMenuButton Label="New" Icon="/SampleImages/Document32.png"/>
</ribbon:ApplicationMenu>
This example shows how to create a ApplicationMenu in C#.
Ribbon ribbon;
RibbonButton button1;
RibbonButton button2;
ApplicationMenu menu = new ApplicationMenu();
menu.MenuItems.Add(button1);
menu.MenuItems.Add(button2);
ribbon.ApplicationMenu = menu;
Constructors
ApplicationMenu()
Initializes a new instance of the ApplicationMenu class.
Declaration
public ApplicationMenu()
Fields
ApplicationButtonImageHeightProperty
Gets or sets ApplicationButton image height. This is a dependency property.
Declaration
public static readonly DependencyProperty ApplicationButtonImageHeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ApplicationButtonImageProperty
Gets or sets ApplicationButton image. This is a dependency property.
Declaration
public static readonly DependencyProperty ApplicationButtonImageProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ApplicationButtonImageWidthProperty
Gets or sets ApplicationButton image width. This is a dependency property.
Declaration
public static readonly DependencyProperty ApplicationButtonImageWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
internalMenuItemsProperty
Declaration
public static readonly DependencyProperty internalMenuItemsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsBelowAppButtonProperty
Defines whether Application button is below ApplicationMenu or not. This is a dependency property.
Declaration
public static readonly DependencyProperty IsBelowAppButtonProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsKeyTipShownProperty
Defines whether key tips are shown or not. This is a dependency property.
Declaration
public static readonly DependencyProperty IsKeyTipShownProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsPopupOpenProperty
Defines whether PopUp is open or not. This is a dependency property.
Declaration
public static readonly DependencyProperty IsPopupOpenProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PreviewPanelMinWidthProperty
Declaration
public static readonly DependencyProperty PreviewPanelMinWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectedItemProperty
Defines the selected application menu item. This is a dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
ApplicationButtonImage
Gets or sets ApplicationButton image.
Declaration
public ImageSource ApplicationButtonImage { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.ImageSource |
ApplicationButtonImageHeight
Gets or sets ApplicationButton image.
Declaration
public double ApplicationButtonImageHeight { get; set; }
Property Value
| Type |
|---|
| System.Double |
ApplicationButtonImageWidth
Gets or sets ApplicationButton image.
Declaration
public double ApplicationButtonImageWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
ApplicationItems
Gets the collection of ApplicationItems objects.
Declaration
public ObservableCollection<object> ApplicationItems { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<System.Object> |
internalMenuItems
Gets or sets a value of the MenuItems of the Application Menu
Declaration
public ObservableCollection<object> internalMenuItems { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<System.Object> |
IsBelowAppButton
Gets or sets a value indicating whether this instance is below app button.
Declaration
public bool IsBelowAppButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsKeyTipShown
Gets or sets a value indicating whether this instance is key tip shown.
Declaration
public bool IsKeyTipShown { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsPopupOpen
Gets or sets a value indicating whether this instance is popup open.
Declaration
public bool IsPopupOpen { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
MenuItems
Gets the collection of MenuItems objects.
Declaration
public ObservableCollection<object> MenuItems { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<System.Object> |
PreviewPanelMinWidth
Gets or sets the PreviewPanel minimum width
Declaration
public double PreviewPanelMinWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
SelectedItem
Gets or sets the selected application menu item.
Declaration
public MenuButtonBase SelectedItem { get; set; }
Property Value
| Type |
|---|
| MenuButtonBase |
Methods
Dispose()
Called when [Application menu unloaded].
Declaration
public void Dispose()
OnApplyTemplate()
Invoked whenever application code or internal processes call ApplyTemplate.
Declaration
public override void OnApplyTemplate()
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. |
OnGotMouseCapture(MouseEventArgs)
Invoked when an unhandled Mouse.GotMouseCapture 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 OnGotMouseCapture(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The MouseEventArgs that contains the event data. |
OnIsPopupOpenChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises IsPopupOpenChanged event.
Declaration
protected virtual void OnIsPopupOpenChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property changes 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. |
OnLostMouseCapture(MouseEventArgs)
Invoked when an unhandled Mouse.LostMouseCapture 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 OnLostMouseCapture(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | TheMouseEventArgs that contains event data. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonDown(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 pressed. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseMove�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 OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The System.Windows.Input.MouseEventArgs that contains the event data. |
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. |
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 |
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 changes 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 |
OnTouchDown(TouchEventArgs)
Provides class handling for the TouchDown routed event that occurs when a touch presses inside this element.
Declaration
protected override void OnTouchDown(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | 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 |
Events
IsPopupOpenChanged
Event that is raised when IsPopupOpen property is changed.
Declaration
public event PropertyChangedCallback IsPopupOpenChanged
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 |