0

主题。单击 ContextMenuItem 时,事件显示一切正常,但前景和背景始终是全白的。

    <toolkit:ContextMenuService.ContextMenu >
        <toolkit:ContextMenu x:Name="Menu1">

            <toolkit:MenuItem Header="item1" Click="MenuItem_Click"/>
            <toolkit:MenuItem Header="item2" Click="MenuItem_Click" />
            <toolkit:MenuItem Header="item3" Click="MenuItem_Click" />

            <toolkit:ContextMenu.ItemContainerStyle >
                <Style TargetType="toolkit:MenuItem">
                    <Setter Property="Background" Value="YellowGreen" />
                    <Setter Property="Margin" Value="5" />
                    <Setter Property="Foreground" Value="Red"/>
                </Style>
            </toolkit:ContextMenu.ItemContainerStyle>

        </toolkit:ContextMenu>
    </toolkit:ContextMenuService.ContextMenu>
4

0 回答 0