protected override void OnMouseDown(MouseButtonEventArgs e) { base.OnMouseDown(e); Point p = e.GetPosition(this); MessageBox.Show(p.ToString()); }I suspect that you need to refer to the window not from it own class but from other point of the application. In this case Application.Current.MainWindow will help you.
Reference:
http://stackoverflow.com/questions/386731/get-absolute-position-of-element-within-the-window-in-wpf
No comments:
Post a Comment