I understand the demands.
The thing is, there are WPF Methods for getting those values - but yes, one of the contributors is right, not directly.
The Solution is not to get all those workarounds, but to change the initial approach according to clean Design and Development.
A) Set the initial Main Window to Screen
B) Get the Values for the ActualWindow including a ton of useful WPF Methods
C) You can add as many Windows as you like for the behaviour you want to have, like resizeable, minimized whatever… but now you always can access the Loaded and Rendered Screen
Please be careful with the following example, there is some Code around that makes it necessary to use that kind of approach, however it should work (It would give you the Points for each of the Corners of your Screen):
Working Example on Single, Dual Monitor and different Resolutions (Within the Primal Main Window Class):
InitializeComponent();
[…]
ActualWindow.AddHandler(Window.LoadedEvent, new RoutedEventHandler(StartUpScreenLoaded));
Routed Event:
private void StartUpScreenLoaded(object sender, RoutedEventArgs e)
{
Window StartUpScreen = sender as Window;
// Dispatcher Format B:
Dispatcher.Invoke(new Action(() =>
{
// Get Actual Window on Loaded
StartUpScreen.InvalidateVisual();
System.Windows.Point CoordinatesTopRight = StartUpScreen.TranslatePoint(new System.Windows.Point((StartUpScreen.ActualWidth), (0d)), ActualWindow);
System.Windows.Point CoordinatesBottomRight = StartUpScreen.TranslatePoint(new System.Windows.Point((StartUpScreen.ActualWidth), (StartUpScreen.ActualHeight)), ActualWindow);
System.Windows.Point CoordinatesBottomLeft = StartUpScreen.TranslatePoint(new System.Windows.Point((0d), (StartUpScreen.ActualHeight)), ActualWindow);
// Set the Canvas Top Right, Bottom Right, Bottom Left Coordinates
System.Windows.Application.Current.Resources["StartUpScreenPointTopRight"] = CoordinatesTopRight;
System.Windows.Application.Current.Resources["StartUpScreenPointBottomRight"] = CoordinatesBottomRight;
System.Windows.Application.Current.Resources["StartUpScreenPointBottomLeft"] = CoordinatesBottomLeft;
}), DispatcherPriority.Loaded);
}