1

Topic: from MenuItem

Is UserControl <UserControl x:Class = "MyNamespace. MyView"... x:Name = "MyControl"> On it there are everyones , and to one is fastened  Behavior which sometimes shows ContextMenu. Shows so: Menu. PlacementTarget = AssociatedObject; Menu. IsOpen = true; the Menu to Behavior  so: <behaviors:MyBehavior Menu = "{StaticResource SharedMenu}"> for this purpose the menu "" so: <UserControl. Resources> <ResourceDictionary> <wpf:ContextMenu x:Key = "SharedMenu"> <MenuItem Header = "Some text..." Command = "..." /> To this place all "works" (the menu is shown). A question: how to write  for a command which sticks out property from most jurez-kontrola? Here it does not work: <MenuItem Command = "{Binding Path=MyControlCommand, Source = {x:Reference MyControl}}"/> and here it, for a command  which sticks out  from ViewModel which  in DataContext jurez-kontrola, - works <MenuItem Command = "{Binding Path=DataContext. MyViewModelCommand, Source = {x:Reference MyControl}}"/> Or I generally incorrectly do all? In advance many thanks.

2

Re: from MenuItem

Y> the Question: Y> how to write  for a command which sticks out property from most jurez-kontrola? All is simple. The command formed and inscribed in property in the designer , but after InitializeComponent ();