private static void UpdateLastKnownDimensions(ContainerBase container, ControlBase control)
 {
     container.LastKnownHeight = !double.IsNaN(control.Height) ? control.Height : control.ActualHeight;
     container.LastKnownWidth = !double.IsNaN(control.Width) ? control.Width : control.ActualWidth;
 }
        private static void InitializeDockedProperties(ContainerBase control)
        {
            if (control == null) throw new ArgumentNullException("control");

            control.RenderTransform = null;
            control.Height = double.NaN;
            control.Width = double.NaN;
            control.HorizontalAlignment = HorizontalAlignment.Stretch;
            control.VerticalAlignment = VerticalAlignment.Stretch;
            control.Margin = new Thickness(0);
            Grid.SetColumn(control, 0);
            Grid.SetRow(control, 0);

            if (control is WindowBase && ((WindowBase)control).VisualState == WindowLayoutState.Floating)
            {
                ((WindowBase)control).VisualState = WindowLayoutState.Docked;
                ((WindowBase)control).IsDragEnabled = false;
            }
        }