ContextMenuService.HasDropShadow 연결된 속성

정의

ContextMenu에 그림자 효과를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다.

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

예제

다음 예에서는 두 단추에 동일한 ContextMenu 단추를 할당하고 , Placement, PlacementRectangleHorizontalOffsetVerticalOffset 속성을 설정HasDropShadow하여 각 단추에 ContextMenu 대해 서로 다른 위치로 설정합니다.

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

설명

ContextMenu 열면 값이 값으로 SystemParameters.DropShadow설정됩니다. 속성이 .인 경우 SystemParameters.DropShadow 이 속성을 true false설정해도 아무 효과가 없습니다.

종속성 속성 정보

식별자 필드 HasDropShadowProperty
메타 데이터 속성 설정 true 없음

적용 대상

추가 정보