Detect an attached DependencyProperty from code-behind in WPF
I have a class named MenuItemHelp开发者_开发技巧er
which attach a GroupName
property to my MenuItem
s in WPF (I get this from here).
How do I set or get it's value from code-behind?
The methods for doing it should be in the MenuItemHelper class:
MenuItemHelper.SetGroupName(someMenuItem, "a group name");
string groupName = MenuItemHelper.GetGroupName(someMenuItem);
精彩评论