views:

25

answers:

1

I have project which implements MVVM pattern. I have WPF window which has reusable usercontrol in his xaml. UserControl consist of WPFDataGrid. Also DataGrid has ContextMenu. I want do some staff when context menu is closed. But ContextMenu class have not dependency property which give me ability to know is it close or not. I cannot farword his Close event to the ViewModel because I havent ViewModel object in the level of UserControl. I think that I can do this this using attached DependecyProperty and create IsClosed attached property for ContextMenu Class.

Question: How can do this with attached dependecy property or other approach using MVVM?

P.S. Code snippet is desirable

+1  A: 

But it do have IsOpen :-)

Meleak
Shame me)) I didn't see this Property) Thank you!
Polaris