Docking Layout Inconsistencies

Docking/MDI for WPF Forum

Posted 8 years ago by Shawn Kramer
Version: 11.2.0552
Avatar

Hello,

I am trying to use the Actipro DockSite Save Layout and Load Layout features. However, when I attempt to load the layout back I get a different layout then what was saved. I have verified the Load layout is loading the same exact xml string that was saved.

Here's the xaml that is used to define the Docksite:

<docking:DockSite x:Name="RootDockSite" IsLiveSplittingEnabled="True" UseHostedRaftingWindows="False" UseHostedDockGuides="False" UseLayoutRounding="True" UseHostedAutoHidePopups="False"> <docking:DockSite.AutoHideBottomContainers> <docking:ToolWindowContainer> <docking:ToolWindow Title="Journal" CanClose="False"> <localControls:Journal DataContext="{Binding}" ></localControls:Journal> </docking:ToolWindow> </docking:ToolWindowContainer> </docking:DockSite.AutoHideBottomContainers> <docking:SplitContainer> <docking:SplitContainer Orientation="Vertical"> <docking:SplitContainer> <!-- Top Left Dock - Workspace Hosts Mimic and other Tabs Start--> <docking:ToolWindowContainer docking:DockSite.ToolWindowsTabPlacement="Top"> <docking:ToolWindow Title="Device 8500" CanClose="False" CanBecomeDocument="False"> <Grid> <ScrollViewer x:Name="Mimic" HorizontalScrollBarVisibility="Auto" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True"> <sharedControls:Rack x:Name="rackControl" DataContext="{Binding}" SelectedCard="{Binding DiagnosticsVM.SelectedCard, Mode=OneWayToSource}" ReadCardInfo="rackControl_ReadCardInfo" WriteCardInfo="rackControl_WriteCardInfo" MouseDown="rackControl_MouseDown" SerialNumber="{Binding DiagnosticsVM.SerialNum, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" BackplaneId="{Binding DiagnosticsVM.BackplaneId, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" ErrorMessageVersion="{x:Static cultureVM:SessionViewResources.Rack_Version}" ErrorMessageBackplaneId=""> <sharedControls:Rack.HWVersion> <Binding Path="DiagnosticsVM.HWVersion" Mode="TwoWay" UpdateSourceTrigger="LostFocus" > </Binding> </sharedControls:Rack.HWVersion> <sharedControls:Rack.ManufacturingDate> <Binding Path="DiagnosticsVM.MfgDate" Mode="TwoWay" UpdateSourceTrigger="LostFocus" ></Binding> </sharedControls:Rack.ManufacturingDate> <sharedControls:Rack.RenderTransform> <ScaleTransform ScaleX="{Binding ElementName=sliderScale, Path=Value}" ScaleY="{Binding ElementName=sliderScale, Path=Value}" ></ScaleTransform> </sharedControls:Rack.RenderTransform> </sharedControls:Rack> </ScrollViewer> <Slider x:Name="sliderScale" HorizontalAlignment="Left" VerticalAlignment="Top" Opacity=".5" TickPlacement="TopLeft" Orientation="Vertical" Height="50" SmallChange="0.2" Value=".7" Margin="5, 5, 0,0" Minimum="0.5" Maximum="3" LargeChange="0.4" TickFrequency="0.2"></Slider> </Grid> </docking:ToolWindow> </docking:ToolWindowContainer> <!-- Top Left Dock - Workspace Hosts Mimic and other Tabs End--> <!-- Right side tabbed panel Start--> <docking:ToolWindowContainer docking:DockSite.ControlSize="50,200"> <!-- Session Properties Start--> <docking:ToolWindow Title="Session Details" CanClose="False" > <ScrollViewer x:Name="SessionProperties"> <Grid Style="{StaticResource PropertiesGridStyle}" Margin="0,0,0,10"> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" Grid.Column="0" Text="Session Name:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="1" Grid.Column="0" Text="Device Address:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="2" Grid.Column="0" Text="Hardware ID:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="3" Grid.Column="0" Text="Device Name:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="4" Grid.Column="0" Text="Device Type:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="5" Grid.Column="0" Text="Firmware Version:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="6" Grid.Column="0" Text="Connected Status:" Style="{StaticResource PromptStyle}"></TextBlock> <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.Name}"></TextBlock> <TextBlock Grid.Row="1" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.DeviceAddress}"></TextBlock> <TextBlock Grid.Row="2" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.DeviceModel.DeviceHardwareId}"></TextBlock> <TextBlock Grid.Row="3" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.DeviceModel.Name}"></TextBlock> <TextBlock Grid.Row="4" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.DeviceType, Mode=OneWay}"></TextBlock> <TextBlock Grid.Row="5" Grid.Column="1" Style="{StaticResource LabelStyle}" Text="{Binding Session.DeviceModel.FirmwareVersion, Mode=OneWay}"></TextBlock> <CheckBox Grid.Row="6" Grid.Column="1" IsChecked="{Binding Session.IsConnected, Mode=OneWay}" IsEnabled="False" Style="{StaticResource RedGreenCheckBox}" Width="13" Height="13" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="7,0,0,0"></CheckBox> </Grid> </ScrollViewer> </docking:ToolWindow> <!-- Session Properties End--> <!-- Properties (Plotting for now) Start--> <docking:ToolWindow Title="Properties" CanClose="False"> <syncfusionProps:PropertyGrid SelectedObject="{Binding SelectedObjectForPropertyGrid}" ></syncfusionProps:PropertyGrid> </docking:ToolWindow> <!-- Properties (Plotting for now) End--> <!-- Data Grid Start--> <docking:ToolWindow Title="Scalar Data" CanClose="False"> <Grid x:Name="LiveDataGrid"> <localControls:ScalarDataGrid x:Name="dataGrid" DataContext="{Binding}"/> </Grid> </docking:ToolWindow> <!-- Data Grid End--> <docking:ToolWindow Title="Live Waveform" CanRaft="False" CanClose="False"> <Grid x:Name="WaveformChart"> <localControls:Waveform x:Name="waveformPlot" DataContext="{Binding}"/> </Grid> </docking:ToolWindow> <docking:ToolWindow Title="Strip Chart" CanRaft="False" CanClose="False"> <Grid x:Name="LiveDataChart"> <localControls:MyPlotControlXY x:Name="plotControl" DataContext="{Binding}"/> </Grid> </docking:ToolWindow> <!-- Embedded doc site for waveform data plots End--> <!-- Tool Box Start--> <docking:ToolWindow Title="Tool Box" CanClose="False"> <ScrollViewer x:Name="Toolbox"> <localControls:Toolbox DataContext="{Binding}"></localControls:Toolbox> </ScrollViewer> </docking:ToolWindow> <!-- Tool Box End--> </docking:ToolWindowContainer> <!-- Right side tabbed panel End--> </docking:SplitContainer> <!-- Bottom Dock Panel Start--> <docking:ToolWindowContainer ScrollViewer.CanContentScroll="True" x:Name="BottomDockContainer" > <docking:ToolWindow Title="Diagnostics" CanClose="False" x:Name="DiagnosticToolWindow"> <ScrollViewer x:Name="Diagnostics" HorizontalScrollBarVisibility="Auto"> <local:DiagnosticsView DataContext="{Binding DiagnosticsVM}"></local:DiagnosticsView> </ScrollViewer> </docking:ToolWindow> </docking:ToolWindowContainer> <!-- Bottom Dock Panel End--> </docking:SplitContainer> </docking:SplitContainer> </docking:DockSite>

 

Here's the c# I am using to save and load the docksite:

DockSiteLayoutSerializer layoutSerializer = new DockSiteLayoutSerializer();

string layoutString = layoutSerializer.SaveToString(RootDockSite);

... save string to repository

... after reloading exact xml layout string from repository

layoutSerializer.LoadFromString(layoutString, RootDockSite);

here's the serialized DockSite layout xml:

<DockSiteLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SerializationFormat="ToolWindowsOnly">
<AutoHideHost>
<AutoHideTabStrip Side="Bottom">
<ToolWindowContainer AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="200,200" Size="200,200" SelectedWindowUniqueId="56f6a1d3-dd43-4cee-84c5-8401b51f7b91">
<UIElement xsi:type="ToolWindowRef" UniqueId="56f6a1d3-dd43-4cee-84c5-8401b51f7b91" />
</ToolWindowContainer>
</AutoHideTabStrip>
</AutoHideHost>
<Content xsi:type="SplitContainer" AutoHideSize="1330,601" DockedSize="1330,601" DocumentSize="1330,601" FloatingSize="1330,601" Size="1330,601" Orientation="Horizontal">
<UIElement xsi:type="SplitContainer" AutoHideSize="1330,601" DockedSize="1330,601" DocumentSize="1330,601" FloatingSize="1330,601" Size="1330,601" Orientation="Vertical">
<UIElement xsi:type="SplitContainer" AutoHideSize="1330,298" DockedSize="1330,298" DocumentSize="1330,298" FloatingSize="1330,298" Size="1330,298" Orientation="Horizontal">
<UIElement xsi:type="ToolWindowContainer" AutoHideSize="1060,298" DockedSize="1060,298" DocumentSize="1060,298" FloatingSize="1060,298" Size="1060,298" SelectedWindowUniqueId="ca0b9aa9-f327-400b-b6c1-dad757a88de8">
<UIElement xsi:type="ToolWindowRef" UniqueId="ca0b9aa9-f327-400b-b6c1-dad757a88de8" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" AutoHideSize="265,298" DockedSize="265,298" DocumentSize="265,298" FloatingSize="265,298" Size="265,298" SelectedWindowUniqueId="86c3497d-8f1d-4a6e-aea9-1d15ad447244">
<UIElement xsi:type="ToolWindowRef" UniqueId="f42980ba-b332-40c7-bad6-532e581f5d94" />
<UIElement xsi:type="ToolWindowRef" UniqueId="d6eff7e7-a34c-4f3e-b1c7-e3ce45d57a86" />
<UIElement xsi:type="ToolWindowRef" UniqueId="4776cba1-3a11-41ea-a2b7-6dbc13c2e9fd" />
<UIElement xsi:type="ToolWindowRef" UniqueId="cc00c264-0dcf-4daf-b1d6-4c62497bf84f" />
<UIElement xsi:type="ToolWindowRef" UniqueId="86c3497d-8f1d-4a6e-aea9-1d15ad447244" />
</UIElement>
</UIElement>
<UIElement xsi:type="SplitContainer" AutoHideSize="1330,298" DockedSize="1330,298" DocumentSize="1330,298" FloatingSize="1330,298" Size="1330,298" Orientation="Horizontal">
<UIElement xsi:type="ToolWindowContainer" AutoHideSize="1060,298" DockedSize="1060,298" DocumentSize="1060,298" FloatingSize="1060,298" Size="1060,298" SelectedWindowUniqueId="520f82a3-d091-4157-9893-c3c596da5a7d">
<UIElement xsi:type="ToolWindowRef" UniqueId="520f82a3-d091-4157-9893-c3c596da5a7d" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" AutoHideSize="265,298" DockedSize="265,298" DocumentSize="265,298" FloatingSize="265,298" Size="265,298" SelectedWindowUniqueId="2ef28e12-f83f-4c56-a68b-1266b886789d">
<UIElement xsi:type="ToolWindowRef" UniqueId="2ef28e12-f83f-4c56-a68b-1266b886789d" />
</UIElement>
</UIElement>
</UIElement>
</Content>
<ToolWindows>
<ToolWindow UniqueId="56f6a1d3-dd43-4cee-84c5-8401b51f7b91" AutoHideSize="200,200" DockedSize="200,200" DocumentSize="200,200" FloatingSize="200,200" Size="200,200" IsOpen="true" LastState="Docked" State="AutoHide" />
<ToolWindow UniqueId="ca0b9aa9-f327-400b-b6c1-dad757a88de8" AutoHideSize="1060,200" DockedSize="1060,200" DocumentSize="1060,200" FloatingSize="1060,200" Size="1060,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="f42980ba-b332-40c7-bad6-532e581f5d94" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="2ef28e12-f83f-4c56-a68b-1266b886789d" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="d6eff7e7-a34c-4f3e-b1c7-e3ce45d57a86" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="4776cba1-3a11-41ea-a2b7-6dbc13c2e9fd" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="cc00c264-0dcf-4daf-b1d6-4c62497bf84f" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="86c3497d-8f1d-4a6e-aea9-1d15ad447244" AutoHideSize="265,200" DockedSize="265,200" DocumentSize="265,200" FloatingSize="265,200" Size="265,200" IsOpen="true" LastState="Docked" State="Docked" />
<ToolWindow UniqueId="520f82a3-d091-4157-9893-c3c596da5a7d" AutoHideSize="1060,298" DockedSize="1060,298" DocumentSize="1060,298" FloatingSize="1060,298" Size="1060,298" IsOpen="true" LastState="Docked" Name="DiagnosticToolWindow" State="Docked" />
</ToolWindows>
</DockSiteLayout>

As I mentioned. When I reload this saved layout the layout is not the same is it was when saved. I can provide screenshots if needed.

Regards,

Shawn

Comments (6)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Shawn,

For issues like this, please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

Posted 8 years ago by Shawn Kramer
Avatar

Do i email that to: sales@?

 

regards

[Modified 8 years ago]

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Shawn,

Please see our Contact Us page.


Actipro Software Support

Posted 8 years ago by Shawn Kramer
Avatar

I emailed an example project and described how to repro the problem to support@.

Regards,

 

Shawn

[Modified 8 years ago]

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Shawn,

Thank you for the sample. As we note in our documentation, you must set the Name property (or x:Name via XAML) on any windows whose layout you would like to save/restore. The name property is the only way for us to know which layout entry is for a given window.


Actipro Software Support

Posted 8 years ago by Shawn Kramer
Avatar

Thank you. That fixed the problem. I just had to name every ToolWindow. After doing that, the LoadFromString set the layout exactly.

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.