MenuItem.SeparatorStyleKey Özellik

Tanım

olduğunda öğesine uygulanan MenuItem stilin MenuItem Separatorkaynak anahtarını alır.

public:
 static property System::Windows::ResourceKey ^ SeparatorStyleKey { System::Windows::ResourceKey ^ get(); };
public static System.Windows.ResourceKey SeparatorStyleKey { get; }
member this.SeparatorStyleKey : System.Windows.ResourceKey
Public Shared ReadOnly Property SeparatorStyleKey As ResourceKey

Özellik Değeri

ResourceKey

olduğunda öğesine uygulanan stilin MenuItem MenuItem kaynak anahtarı.Separator

Örnekler

Aşağıdaki örnekte, içinde bir Separator stili için bu özelliğin nasıl kullanılacağı gösterilmektedir Menu.

<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>

Açıklamalar

Menüdeki bir Separator öğesinin stilini değiştirmek için bu özelliği kullanın.

XAML Öznitelik Kullanımı

<object property={ MenuItem.SeparatorStyleKey}"/>

Şunlara uygulanır

Ayrıca bkz.