ContextMenu 요소
상황에 맞는 메뉴 컨트롤을 나타냅니다.
사용량
<ContextMenu
Name = "xs:string">
child elements
</ContextMenu>
특성
attribute | Type | 필수 | Description |
---|---|---|---|
이름 |
xs:string |
Yes |
자식 요소
요소 | Description |
---|---|
MenuGroup |
한 번 이상 발생해야 합니다. |
부모 요소
요소 |
---|
ContextPopup.ContextMenus |
설명
선택 사항입니다.
각 ContextPopup.ContextMenus에 대해 하나 이상 발생할 수 있습니다.
예제
다음 예제에서는 ContextPopup 보기에 대한 기본 태그를 보여 줍니다.
이 코드 섹션에서는 ContextMenu 컨트롤 선언 집합을 보여 줍니다.
<ContextPopup>
<!--
The MiniToolbars and Context Menus are the basic ingredients for
the contextual UI popup.
Mix-and-match and associate each combination with a ContextMap Command
invoked in code.
-->
<ContextPopup.MiniToolbars>
<MiniToolbar Name="MiniToolbar1">
<MenuGroup Class="MajorItems">
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
<DropDownButton CommandName="cmdButtons">
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</DropDownButton>
</MenuGroup>
</MiniToolbar>
<MiniToolbar Name="MiniToolbar2">
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</MiniToolbar>
</ContextPopup.MiniToolbars>
<ContextPopup.ContextMenus>
<ContextMenu Name="ContextMenu1">
<MenuGroup>
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
</ContextMenu>
<ContextMenu Name="ContextMenu2">
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
</MenuGroup>
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</ContextMenu>
<ContextMenu Name="ContextMenu4">
<MenuGroup>
<Button CommandName="cmdCut" />
<Button CommandName="cmdCopy" />
<Button CommandName="cmdPaste" />
</MenuGroup>
<MenuGroup>
<ToggleButton CommandName="cmdToggleButton" />
</MenuGroup>
<MenuGroup>
<Button CommandName="cmdButton1" />
<Button CommandName="cmdButton2" />
<Button CommandName="cmdButton3" />
</MenuGroup>
</ContextMenu>
</ContextPopup.ContextMenus>
<ContextPopup.ContextMaps>
<ContextMap CommandName="cmdContextMap1"
ContextMenu="ContextMenu1"/>
<ContextMap CommandName="cmdContextMap2"
ContextMenu="ContextMenu2"
MiniToolbar="MiniToolbar1"/>
<ContextMap CommandName="cmdContextMap3"
MiniToolbar="MiniToolbar2"/>
<ContextMap CommandName="cmdContextMap4"
ContextMenu="ContextMenu4"/>
</ContextPopup.ContextMaps>
</ContextPopup>
요소 정보
- 지원되는 최소 시스템: Windows 7
- 비워 둘 수 있음: 아니요