■ TextBlock 엘리먼트 : 컨텍스트 메뉴 사용하기

----------------------------------------------------------------------------------------------------

<TextBlock

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    HorizontalAlignment="Center"

    VerticalAlignment="Center"

    FontSize="24pt"

    ToolTip="Right click to display context menu">

    TextBlock with Context Menu

    <TextBlock.ContextMenu>

        <ContextMenu MenuItem.Click="menuItem_Click">

            <MenuItem Header="Red"    />

            <MenuItem Header="Orange" />

            <MenuItem Header="Yellow" />

            <MenuItem Header="Green"  />

            <MenuItem Header="Blue"   />

            <MenuItem Header="Indigo" />

            <MenuItem Header="Violet" />

        </ContextMenu>

    </TextBlock.ContextMenu>

</TextBlock>

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요