1

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.

DonBoitnott
  • 10,787
  • 6
  • 49
  • 68
  • You could use the same tab control instead of the `ContentControl` as your view container. Just make the tab headers invisible and switch the tabs between navigation and MDI container. – dymanoid Jul 21 '17 at 09:12
  • @dymanoid A little "slight of hand"? An interesting approach, and I'll give that some thought. – DonBoitnott Jul 21 '17 at 12:19
  • @dymanoid I have attempted to implement what you've suggested, but I've hit a wall. Check out [this question](https://stackoverflow.com/questions/45311882/how-can-i-conditionally-hide-the-tabpanel-portion-of-a-tabcontrol-in-its-entiret) if you're interested in helping further. – DonBoitnott Jul 25 '17 at 19:22

0 Answers0