I'll be referencing the custom TabControl
used in this answer, so please check that out first.
That answer gives me the MDI-type view that I am after. The tabs themselves preserve nicely, while that view is on-screen.
However, that is just one of two views that the MainWindow
can display. The other is a navigation view with icons that the user can click to open different sections, which open as tabs in the TabControl
.
So the question is, how can I preserve the state of the entire TabControl
(MDI) view itself, in addition to what the linked answer does? In other words, I need to be able to freely flip back and forth between this navigation view, and the TabControl
view without losing the state of either one. But the switching causes the MDI view to Unload
, and then I lose the state of all tabs (MDI views).
The MainWindow
is using this as the content holder for the two views it can display:
<ContentControl Grid.Row="1"
Content="{Binding CurrentViewModel}" />
The CurrentViewModel
is assigned an instance of either the MDITabControlViewModel
or HomeViewModel
.