Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1770
The 'InitialLocation' cannot be changed once a SplitPane is associated with a 'XamDockManager'
posted

This is what I have:

<Window.Resources>

<DataTemplate DataType="{x:Type viewModel:LogsViewModel}">
<ig:XamDockManager LayoutMode="FillContainer" Background="LightBlue" >
<ig:XamDockManager.Panes>
<ig:SplitPane ig:XamDockManager.InitialLocation="DockedRight">
<ig:ContentPane x:Name="StateTransDock" Header="State Transissions" IsPinned="True" AllowClose="False" CloseButtonVisibility="Hidden">
</ig:ContentPane>
</ig:SplitPane>
</ig:XamDockManager.Panes>
</ig:XamDockManager>
</DataTemplate>

<DataTemplate DataType="{x:Type viewModel:ReportsViewModel}">

<Label FontSize="50">THIS IS WHERE THE REPORTS GO</Label>

</DataTemplate>
</Window.Resources>

<ContentControl  Content="{Binding CurrentPageViewModel}" Grid.Row="1" Grid.Column="1"/>

So I switch the content out based on what is clicked in the application by assigning the appropriate view model to CurrentPageViewModel. The initial view model that gets loaded is the one with the dock manager (viewModel:LogsViewModel). When I switch to viewModel:ReportsViewModel then back to viewModel:LogsViewModel in the application I get this exception:

The 'InitialLocation' cannot be changed once a SplitPane is associated with a 'XamDockManager'

How can I get around this using a solution that keeps my UI decoupled from the view model? Thanks