Table of Contents

Class MenuItemViewModel

Namespace
Acuit.Pinpoint.Windows
Assembly
Acuit.Pinpoint.Windows.dll

View model for a menu item.

public class MenuItemViewModel : NotificationObject, INotifyPropertyChanged
Inheritance
NotificationObject
MenuItemViewModel
Implements
Derived
Inherited Members
NotificationObject.PropertyChanged

Properties

Command

Gets or sets the menu item command.

public ICommand Command { get; set; }

Property Value

ICommand

Header

Gets or sets the header text.

public string Header { get; set; }

Property Value

string

IsChecked

Gets or sets whether the menu item should be checked.

public bool IsChecked { get; set; }

Property Value

bool

IsSeparator

Gets or sets whether this represents a separator.

public bool IsSeparator { get; set; }

Property Value

bool

IsSubmenuOpen

Gets or sets whether this menu's submenu is open.

public bool IsSubmenuOpen { get; set; }

Property Value

bool

IsVisible

Gets or sets whether the menu item should be visible.

public bool IsVisible { get; set; }

Property Value

bool

Items

Gets the collection of child items.

public ObservableCollection<MenuItemViewModel> Items { get; }

Property Value

ObservableCollection<MenuItemViewModel>

SortHint

Gets or sets the sort hint.

public string SortHint { get; set; }

Property Value

string

Remarks

Items with SortHint values that are not null or empty will appear first, ordered in ascending order by their SortHint values, as a simple ordinal comparison (i.e., via CompareOrdinal(string, string). Then items with null or empty SortHint values will appear, in the order in which they were added.

This is only used as items are added via the AddChildItem(MenuItemViewModel) and AddChildItems(IEnumerable<MenuItemViewModel>) methods. Changing this value later will not cause the menu item to change sort position.

Methods

AddChildItem(MenuItemViewModel)

Adds the specified menu item, honoring its sort hint.

public void AddChildItem(MenuItemViewModel item)

Parameters

item MenuItemViewModel

The item to add.

Exceptions

ArgumentNullException

item is null.

AddChildItems(IEnumerable<MenuItemViewModel>)

Adds the specified menu items, honoring their sort hints as they are added.

public void AddChildItems(IEnumerable<MenuItemViewModel> items)

Parameters

items IEnumerable<MenuItemViewModel>

The items to add.

Exceptions

ArgumentNullException

items is null.

Events

SubmenuOpened

Occurs when this menu's submenu opened.

public event EventHandler SubmenuOpened

Event Type

EventHandler