ContextMenuService.HasDropShadow İliştirilmiş Özellik

Tanım

gölge efektinin etkin olup olmadığını ContextMenu belirten bir değer alır veya ayarlar.

see GetHasDropShadow, and SetHasDropShadow
see GetHasDropShadow, and SetHasDropShadow
see GetHasDropShadow, and SetHasDropShadow

Örnekler

Aşağıdaki örnek, aynı ContextMenu öğeyi iki düğmeye atar ve her düğme için farklı konumlara ayarlamak üzere , PlacementRectanglePlacement, , HorizontalOffsetve VerticalOffset özelliklerini ayarlarHasDropShadowContextMenu.

<StackPanel>
  <StackPanel.Resources>
    <ContextMenu x:Key="myContextMenu">
      <MenuItem Header="Item"/>
    </ContextMenu>
  </StackPanel.Resources>

  <!--Both buttons use the same ContextMenu but use the
    properties on ContextMenuService to position them
    differently.-->
  <Button ContextMenu="{StaticResource myContextMenu}" 
          ContextMenuService.HasDropShadow="False" 
          ContextMenuService.Placement="Relative"
          ContextMenuService.HorizontalOffset="50"
          ContextMenuService.VerticalOffset="-10">
    button 1
  </Button>

  <Button ContextMenu="{StaticResource myContextMenu}" 
          ContextMenuService.HasDropShadow="True"
          ContextMenuService.Placement="Right"
          ContextMenuService.PlacementRectangle="0,0,30,30">
    button 2
  </Button>
</StackPanel>

Açıklamalar

ContextMenu açıldığında, değeri değerine SystemParameters.DropShadowayarlanır. özelliği ise falsebu özelliği true olarak ayarlamanın SystemParameters.DropShadow hiçbir etkisi olmaz.

Bağımlılık Özelliği Bilgileri

Tanımlayıcı alanı HasDropShadowProperty
Meta veri özellikleri olarak ayarlandı true Hiçbiri

Şunlara uygulanır

Ayrıca bkz.