How do I know what monitor a WPF window is in
.net, c#, wpf
Solution
If the window is maximized then you cannot rely on window.Left or window.Top at all since they may be the coordinates before it was maximized. But you can do this in all cases:
var screen = System.Windows.Forms.Screen.FromHandle(
new System.Windows.Interop.WindowInteropHelper(window).Handle);
Problem
In a C# application, how can I find out if a WPF window is in the primary monitor or another monitor?