private void OnLoaded(object sender, RoutedEventArgs e)
{
Controller.OnViewReady();
// Data binding these properties doesnt seem to work so well. Desired values are overwritten with other values multiple times.
Width = Controller.WindowSize.X;
Height = Controller.WindowSize.Y;
Left = Controller.WindowTopLeft.X;
Top = Controller.WindowTopLeft.Y;
// This is necessary because the controller must not be notified until the above sizes have been set, this doesnt happen immediately otherwise the desired value is overwritten.
this.sizeHasBeenSet = true;
}