private bool CheckVirtualScreenSize()
{
var w = SystemParameters.VirtualScreenWidth;
var h = SystemParameters.VirtualScreenHeight;
var ox = SystemParameters.VirtualScreenLeft;
var oy = SystemParameters.VirtualScreenTop;
// TODO: Remove 10 pixel check if others can't reproduce
// On Ian's Windows 8 setup, when Dynamo is maximized, the origin
// saves at -8,-8. There doesn't seem to be any documentation on this
// so we'll put in a 10 pixel check to still allow the window to maximize.
if (dynamoViewModel.Model.PreferenceSettings.WindowX < ox - 10 ||
dynamoViewModel.Model.PreferenceSettings.WindowY < oy - 10)
{
return false;
}
// Check that the window is smaller than the available area.
if (dynamoViewModel.Model.PreferenceSettings.WindowW > w ||
dynamoViewModel.Model.PreferenceSettings.WindowH > h)
{
return false;
}
return true;
}