Is it a good practice to find the workarea measurement and set some properties in code so that it could be bound to Control\'s margin or height/Width properties in xaml?
Small correction to the answer of Fredrik Hedblad:
because you have set the DependencyProperty "Denominators" in the Grid element:
 
you must call the GetDominator method using the grid. Instead of:
private static void CalculateScale(Window window)
{
    var denominators = GetDenominators(window);
}
you must use something like this:
private static void mainElement_SizeChanged(object sender, SizeChangedEventArgs e)
{
    var mainElement = sender as FrameworkElement;
    var window = GetParentWindow(mainElement);
    CalculateScale(window, mainElement);
}
private static void CalculateScale(Window window, FrameworkElement mainElement)
{
    var denominators = GetDenominators(mainElement);
}