다음을 통해 공유


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값으로 설정됩니다. 속성이 true .인 경우 SystemParameters.DropShadow 이 속성을 false설정해도 효과가 없습니다.

종속성 속성 정보

Item 가치
식별자 필드 HasDropShadowProperty
메타데이터 속성이 다음으로 설정됩니다. true 없음

적용 대상

추가 정보