amiry jd
amiry jd

Reputation: 27585

Detect an attached DependencyProperty from code-behind in WPF

I have a class named MenuItemHelper 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?

Upvotes: 2

Views: 231

Answers (1)

Sean U
Sean U

Reputation: 6850

The methods for doing it should be in the MenuItemHelper class:

MenuItemHelper.SetGroupName(someMenuItem, "a group name");
string groupName = MenuItemHelper.GetGroupName(someMenuItem);

Upvotes: 3

Related Questions