开发者

Detect an attached DependencyProperty from code-behind in WPF

开发者 https://www.devze.com 2023-03-08 10:55 出处:网络
I have a class named MenuItemHelp开发者_开发技巧er which attach a GroupName property to my MenuItems in WPF (I get this from here).

I have a class named MenuItemHelp开发者_开发技巧er which attach a GroupName property to my MenuItems 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);
0

精彩评论

暂无评论...
验证码 换一张
取 消