Hi, I am using a MVVM pattern for a WPF UserControl. I need to be able to position a dialog over the top of the control, so I need the top left screen coords for the control.
IF, I was to use code behind, the following seems to do the job..
private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Point controlPos = PointToScreen(new Point(0, 0));
...
}
The controlPos above seems to give the correct result. However, is there anyway of doing this without having to use any code behind in the actual control (eg have the code purley perhaps in the View model class, of have something in the Controls XAML?
Thanks in advance for any help
regards
Peter
View Complete Post