When you open the context menu on Canvas, you need to save the menu coordinates in MainVM.
Through events, this is done simply:
Xaml:
<Canvas ContextMenuOpening="Canvas_OnContextMenuOpening" /> Code-behind:
class MainVM : ViewModelBase { public static Point ContextMenuPoint {get; set;} } //..... private void Canvas_OnContextMenuOpening(object sender, ContextMenuEventArgs e) { MainVM.ContextMenuPoint.X = e.CursorLeft; MainVM.ContextMenuPoint.Y = e.CursorTop; } How to do the same, but through the team?
ContextMenuOpeningevent handler. Those. I click RMB onCanvas- a context menu appears. I save the coordinates in the field of typePoint, for example,pX = e.CursorLeft. Everything. In the case of teams, the concept is not clear to me. How to make a call to a command that saves coordinates when a menu appears, how to pick up menu coordinates, etc. - trydex