MenuItem.Icon Property

 

Gets or sets the icon that appears in a MenuItem.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

[BindableAttribute(true)]
public object Icon { get; set; }

Property Value

Type: System.Object

The icon that appears in a MenuItem. The default value is null.

Many Menu controls have more than just text in the MenuItem elements. Often there are icons, check marks, accelerators, and arrows to indicate submenus.

Identifier field

IconProperty

Metadata properties set to true

None

The following example creates a menu item with an icon.

<MenuItem Header="New">
  <MenuItem.Icon>
    <Image Source="data/cat.png"/>
  </MenuItem.Icon>
</MenuItem>

.NET Framework
Available since 3.0
Return to top
Show: