logo
VitNX3 Documentation

# VitNX_DockPanel.GetDockPanelState Method

Namespace: VitNX.UI.ControlsV1.Docking
Assembly: VitNX3 (in VitNX3.dll)
VB
C#
F#
C++
JScript
Copy

    public DockPanelState GetDockPanelState()

    This language is not supported or no code example is available.

#### Return Value

DockPanelState
Source code
VB
C#
F#
C++
JScript
Copy

    public DockPanelState GetDockPanelState()
     {
         var state = new DockPanelState();
         state.Regions.Add(new DockRegionState(VitNX_DockArea.Document));
         state.Regions.Add(new DockRegionState(VitNX_DockArea.Left,
             _regions[VitNX_DockArea.Left].Size));
         state.Regions.Add(new DockRegionState(VitNX_DockArea.Right,
             _regions[VitNX_DockArea.Right].Size));
         state.Regions.Add(new DockRegionState(VitNX_DockArea.Bottom,
             _regions[VitNX_DockArea.Bottom].Size));
         var _groupStates = new Dictionary<VitNX_DockGroup, DockGroupState>();
         var orderedContent = _contents.OrderBy(c => c.Order);
         foreach (var content in orderedContent)
         {
             foreach (var region in state.Regions)
             {
                 if (region.Area == content.DockArea)
                 {
                     DockGroupState groupState;
                     if (_groupStates.ContainsKey(content.DockGroup))
                         groupState = _groupStates[content.DockGroup];
                     else
                     {
                         groupState = new DockGroupState();
                         region.Groups.Add(groupState);
                         _groupStates.Add(content.DockGroup, groupState);
                     }
                     groupState.Contents.Add(content.SerializationKey);
                     groupState.VisibleContent = content.DockGroup.VisibleContent.SerializationKey;
                 }
             }
         }
         return state;
     }

    This language is not supported or no code example is available.

Applies to

#### .NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

#### .NET Core

Supported in: 5.0+, 6.0+
See Also
VitNX_DockPanel Class
VitNX.UI.ControlsV1.Docking Namespace