Example #1
0
        public void Initialize(IStackedContentChild mainChild, MainWindowControlState state)
        {
            horizontalContent.AddChild(verticalContent);
            verticalContent.AddChild(mainChild, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star), 30));

            foreach (var kv in state.SavedLocations)
            {
                savedLocations[kv.Key] = kv.Value;
            }

            if (state.LeftState != null && state.RightState != null && state.TopState != null && state.BottomState != null)
            {
                state.LeftState.Restore(this, toolWindowUIs[AppToolWindowLocation.Left]);
                state.RightState.Restore(this, toolWindowUIs[AppToolWindowLocation.Right]);
                state.TopState.Restore(this, toolWindowUIs[AppToolWindowLocation.Top]);
                state.BottomState.Restore(this, toolWindowUIs[AppToolWindowLocation.Bottom]);
            }
            else
            {
                RestoreDefault();
            }

            if (state.HorizontalContentState != null && state.VerticalContentState != null)
            {
                horizontalContent.State = state.HorizontalContentState;
                verticalContent.State   = state.VerticalContentState;
            }
        }
Example #2
0
        public void Initialize(IStackedContentChild mainChild, MainWindowControlState state)
        {
            horizontalContent.AddChild(verticalContent);
            verticalContent.AddChild(mainChild, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star), 30));

            foreach (var kv in state.SavedLocations)
                savedLocations[kv.Key] = kv.Value;

            if (state.LeftState != null && state.RightState != null && state.TopState != null && state.BottomState != null) {
                state.LeftState.Restore(this, toolWindowUIs[AppToolWindowLocation.Left]);
                state.RightState.Restore(this, toolWindowUIs[AppToolWindowLocation.Right]);
                state.TopState.Restore(this, toolWindowUIs[AppToolWindowLocation.Top]);
                state.BottomState.Restore(this, toolWindowUIs[AppToolWindowLocation.Bottom]);
            }
            else
                RestoreDefault();

            if (state.HorizontalContentState != null && state.VerticalContentState != null) {
                horizontalContent.State = state.HorizontalContentState;
                verticalContent.State = state.VerticalContentState;
            }
        }