Class MenuButton
Control for a button which pops up a menu of items to choose.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.BotBrain.Controls
Assembly: Phoenix.Plugin.BotBrain.Shared.dll
Syntax
public class MenuButton : UserControl, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, IComponentConnector, IStyleConnectorConstructors
View SourceMenuButton()
Initializes a new instance of the MenuButton class.
Declaration
public MenuButton()Fields
View SourceButtonContentProperty
Identifies the MenuButton.ButtonContent dependency property.
Declaration
public static readonly DependencyProperty ButtonContentPropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
CommandProperty
Identifies the MenuButton.Command dependency property.
Declaration
public static readonly DependencyProperty CommandPropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
DisplayMemberPathProperty
Identifies the MenuButton.DisplayMemberPath dependency property.
Declaration
public static readonly DependencyProperty DisplayMemberPathPropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
EnabledProperty
Identifies the MenuButton.Enabled dependency property.
Declaration
public static readonly DependencyProperty EnabledPropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
Remarks
Workaround for a bug where IsEnabled does not raise property changed.
ItemTemplateProperty
Identifies the MenuButton.ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplatePropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
ItemsSourceProperty
Identifies the MenuButton.ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourcePropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
PopupHorizontalAlignmentProperty
Identifies the MenuButton.PopupHorizontalAlignmentProperty dependency property.
Declaration
public static readonly DependencyProperty PopupHorizontalAlignmentPropertyField Value
| Type | Description | 
|---|---|
| DependencyProperty | 
Properties
View SourceButtonContent
Gets or sets the content within the button.
Declaration
public object ButtonContent { get; set; }Property Value
| Type | Description | 
|---|---|
| object | 
Command
Gets or sets the command for when a menu item is selected.
Declaration
public ICommand Command { get; set; }Property Value
| Type | Description | 
|---|---|
| ICommand | 
DisplayMemberPath
Gets or sets the DisplayMemberPath to use for displaying items.
Declaration
public string DisplayMemberPath { get; set; }Property Value
| Type | Description | 
|---|---|
| string | 
Enabled
Gets or sets a value indicating whether or not the button is enabled.
Declaration
public bool Enabled { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | 
IsOpen
Gets or sets a value indicating whether or not the menu is open.
Declaration
public bool IsOpen { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | 
ItemTemplate
Gets or sets the item template.
Declaration
public DataTemplate ItemTemplate { get; set; }Property Value
| Type | Description | 
|---|---|
| DataTemplate | 
ItemsSource
Gets or sets the items in the popup.
Declaration
public IEnumerable ItemsSource { get; set; }Property Value
| Type | Description | 
|---|---|
| IEnumerable | 
PopupHorizontalAlignment
Gets or sets the PopupHorizontalAlignment property.
Declaration
public HorizontalAlignment PopupHorizontalAlignment { get; set; }Property Value
| Type | Description | 
|---|---|
| HorizontalAlignment | 
Methods
View SourceInitializeComponent()
InitializeComponent
Declaration
public void InitializeComponent()OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
Declaration
public override void OnApplyTemplate()Overrides
Events
View SourceIsOpenChanged
Occurs when the menu is opened or closed.
Declaration
public event EventHandler? IsOpenChangedEvent Type
| Type | Description | 
|---|---|
| EventHandler | 
Opened
Occurs when the menu is opened.
Declaration
public event EventHandler? OpenedEvent Type
| Type | Description | 
|---|---|
| EventHandler |