ContextMenuService.HasDropShadow Proprietà associata

Definizione

Ottiene o imposta un valore che indica se la proprietà ContextMenu ha l'effetto ombreggiatura abilitato.

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

Esempio

Nell'esempio seguente viene assegnato lo stesso ContextMenu a due pulsanti e vengono impostate le HasDropShadowproprietà , , PlacementHorizontalOffsetPlacementRectangle, e VerticalOffset per impostare su ContextMenu posizioni diverse per ogni pulsante.

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

Commenti

Quando si ContextMenu apre, il valore viene impostato sul valore di SystemParameters.DropShadow. Se la SystemParameters.DropShadow proprietà true è false.

Informazioni proprietà di dipendenza

Campo Identificatore HasDropShadowProperty
Proprietà dei metadati impostate su true Nessuno

Si applica a

Vedi anche