I'm wondering about the best way to get information about the current position and width/height of the MainWindow. I want to keep a child window inside the main window so I want to check the coordinates of the MainWindows borders during the move function of the child window. I could only find the Window.LocationChanged event but it doesn't solve my problem in a satisfying way. Are there better options?
You can access the position of the main window all over your code via Application.Current.MainWindow.Left
and Application.Current.MainWindow.Top
, respectively. Hope this will help.
But, you should check "WindowState". In "Maximized" state properties "Left" and "Top" keep the values of the window in it's normal state. Window position in "Maximized" state discribes here: How can I find the position of a maximized window?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With