MenuItem.SeparatorStyleKey Property

Gets the style applied to a MenuItem when the MenuItem is a Separator.

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

public static ResourceKey SeparatorStyleKey { get; }
/** @property */
public static ResourceKey get_SeparatorStyleKey ()

public static function get SeparatorStyleKey () : ResourceKey

You cannot use this property in XAML.

Property Value

Returns a resource key.

This is used when styling menu items.

The following example shows how to use this property to style a Separator in a Menu.

<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
     <Setter Property="Template">
            <ControlTemplate TargetType="{x:Type Separator}">
                <Image Width="50" Height="30" Source="data\separator.png"/>

For the complete sample see Menu Styles Sample.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions