.NET Framework Class Library
MenuItem..::.SeparatorStyleKey Property

Gets the resource key for a style applied to a MenuItem when the MenuItem is a Separator.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic (Declaration)
Public Shared ReadOnly Property SeparatorStyleKey As ResourceKey
Visual Basic (Usage)
Dim value As ResourceKey

value = MenuItem.SeparatorStyleKey
C#
public static ResourceKey SeparatorStyleKey { get; }
Visual C++
public:
static property ResourceKey^ SeparatorStyleKey {
    ResourceKey^ get ();
}
JScript
public static function get SeparatorStyleKey () : ResourceKey
XAML Attribute Usage
<object property={x:Static MenuItem.SeparatorStyleKey}"/>

Property Value

Type: System.Windows..::.ResourceKey
The resource key for a style applied to a MenuItem when the MenuItem is a Separator.
Remarks

Use this property to change the style of a Separator in a menu.

Examples

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

XAML
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
  <Setter Property="OverridesDefaultStyle" Value="true" />
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type Separator}">
        <Border Width="30" Height="4" Margin="4" Background="Red"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker