Check Mark Showing as a Black Box in Menu

前端 未结 1 852
一整个雨季
一整个雨季 2021-01-19 23:03

I have a menu inside a toolbar that needs to be checkable but when I check the items it renders as just a black box (I tried to upload a photo of the issue but StackOverflow

相关标签:
1条回答
  • 2021-01-19 23:39

    The ToolBar element defines some styles for a few controls and the Menu is one of them. You can find the Style key defined in the ToolBar.MenuStyleKey static property. That style is setting the Background to #FF212121 for the Panel which contains the check mark.

    Unfortunately i don't believe that there is a way to change only the background for the check mark's panel, you will have to override that ugly looking MenuItem style.

    Note: to get the style applied in your case follow this steps:

    1. Copy the above XAML in a new VS solution.
    2. Select the Menu in the designer window.
    3. Right click on the Menu/ Edit Template / Edit a copy / Enter.
    0 讨论(0)
提交回复
热议问题