Q: ContextMenu WPF get access from behind code I have a ContextMenu for a ListView.
in a normal situation ListView's ContextMenu has the following Items:


*

*New Folder

*(Separator)

*Paste (if copiedCollection!=null)

*(Separator)

*Properties 


and I have a main Address ExploreAddress which hold the currentAddress,When this Address = "My Computer", then I'd want to change the contextMenu Items to just:


*

*Properties 


(because you can't Paste or make a new folder on "My Computer Address")
I'm thinking of creating an event handler to the class ExploreAddress so whenever the address changed, it checks if (Address =="My Computer") then it changes the contextMenu's Items.
so my first question is How to Create/Change the ContextMenu's Items from the code?
the second question is How would I change IsEnabled Value of the ContextMenuItem Paste when copiedCollection !=null
