private static void UnlockWindows(BaseLayoutItem window)
 {
     if (window.Parent != null)
     {
         foreach (var item in window.Parent.Items)
         {
             BaseLayoutItemState state = GetWindowState(item);
             if (state != null)
             {
                 item.AllowActivate  = state.AllowActivate;
                 item.AllowClose     = state.AllowClose;
                 item.AllowDock      = state.AllowDock;
                 item.AllowDrag      = state.AllowDrag;
                 item.AllowDrop      = state.AllowDrop;
                 item.AllowFloat     = state.AllowFloat;
                 item.AllowHide      = state.AllowHide;
                 item.AllowMaximize  = state.AllowMaximize;
                 item.AllowMinimize  = state.AllowMinimize;
                 item.AllowMove      = state.AllowMove;
                 item.AllowRestore   = state.AllowRestore;
                 item.AllowSelection = state.AllowSelection;
                 item.AllowSizing    = state.AllowSizing;
                 item.Focusable      = state.Focusable;
                 item.IsEnabled      = state.IsEnabled;
                 state = null;
             }
         }
     }
 }
        private static void CreateWindowState(BaseLayoutItem window)
        {
            BaseLayoutItemState state = new BaseLayoutItemState()
            {
                AllowActivate  = window.AllowActivate,
                AllowClose     = window.AllowClose,
                AllowDock      = window.AllowDock,
                AllowDrag      = window.AllowDrag,
                AllowDrop      = window.AllowDrop,
                AllowFloat     = window.AllowFloat,
                AllowHide      = window.AllowHide,
                AllowMaximize  = window.AllowMaximize,
                AllowMinimize  = window.AllowMinimize,
                AllowMove      = window.AllowMove,
                AllowRestore   = window.AllowRestore,
                AllowSelection = window.AllowSelection,
                AllowSizing    = window.AllowSizing,
                Focusable      = window.Focusable,
                IsEnabled      = window.IsEnabled
            };

            SetWindowState(window, state);
        }
 public static void SetWindowState(DependencyObject d, BaseLayoutItemState value)
 {
     d.SetValue(WindowStateProperty, value);
 }