WPF Menu - How to use a different template for top-level items

后端 未结 1 723
-上瘾入骨i
-上瘾入骨i 2021-01-21 23:05

I would like to apply different templates to my WPF menu control depending on whether the item is a \"top level\" item or not. In particular, I want a larger icon above

1条回答
  •  -上瘾入骨i
    2021-01-21 23:43

    You should create two styles for the menu control (in a separate resource dictionary). One is with a style key (for the top-level items) and another one without a key so that one will be the default style. Therefore you need to set the style explicitly only in the top-level items.

    0 讨论(0)
提交回复
热议问题