WPF seems to be lacking a RadioMenuItem
class or similar functionality. In Windows.Forms
, menu items had a RadioChecked
property, but WPF menu items only have IsChecked
. I can put actual RadioButton
s in a MenuItem
, but this feels weird and looks awkward.
How can I create a group of menu items that function like radio buttons in a WPF menu? For reference, see the "Zoom" menu in I开发者_如何转开发E8.
Change the Template
of the MenuItem to display a RadioButton instead of the standard display
I found this and StatckOverflow post another post with Google and neither had an answer that worked for me.
You don't want to use the Template you want to use the ItemContainerStyle.
I put the answer on the other stack overflow post: https://stackoverflow.com/a/11497189/375727
精彩评论