Поделиться через


Элемент ContextMap

Представляет сопоставление пар ContextMenu и MiniToolbar .

Использование

<ContextMap
  CommandName = "xs:positiveInteger or xs:string"
  MiniToolbar = "xs:string"
  ContextMenu = "xs:string"/>

Атрибуты

attribute Тип Обязательно Описание
CommandName
xs:positiveInteger или xs:string
Нет
Связывает элемент с командой.

(xs:positiveInteger или xs:string)
Строка, целочисленное значение от 2 до 59999 включительно или шестнадцатеричное значение в диапазоне от 0x2 до 0xea5f включительно.
Значение должно быть уникальным в XML-документе ленты.
Максимальная длина: 100 символов.
ContextMenu
xs:string
Нет
Должно соответствовать существующему имениContextMenu.

(xs:string)
Строка, состоящая из любой последовательности символов, включая пробелы и символы разрыва строки.
Мини-панель инструментов
xs:string
Нет
Должно соответствовать существующему именимини-панели.

(xs:string)
Строка, состоящая из любой последовательности символов, включая пробелы и символы разрыва строки.

Дочерние элементы

Дочерние элементы отсутствуют.

Родительские элементы

Элемент
ContextPopup.ContextMaps

Комментарии

Необязательный элемент.

Может происходить один или несколько раз для каждого объекта ContextPopup.ContextMaps.

Примеры

В следующем примере демонстрируется базовая разметка для представления ContextPopup .

В этом разделе кода показан набор объявлений элементов управления ContextMap .

    <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
  • Может быть пустым: Да

См. также раздел

Элемент управления Контекстное всплывающее окно