I have a simple question, but for some reason I can't really find an appropriate answer.
In my application I have the following section:
- a toolbar section (left dock)
- a message section (bottom dock)
- a navigation section (fill dock)
In the navigation section I want to show different user controls, depending on which button is pressed in the toolbar.
I have everything in place, but the navigation section always shows a hard-coded user control. I want to show user controls based on the button I pressed.
<DockPanel>
<controls:MainActionBar DockPanel.Dock="Left" DataContext="{Binding MainActionBarViewModel}"/>
<controls:Messages DockPanel.Dock="Bottom" />
<!-- This is where some kind of navigation pane should be at -->
<controls:SystemPCControl DataContext="{Binding SystemPCViewModel}"/>
</DockPanel>
I read all kinds of solutions, varying from Frame
, to ContentView
combined with ContentPresenter
, to juggling visibility settings using Converters
.
Google brings me to some heavy weight solution here.
Did I just run into something far from trivial to achieve in WPF? What's the way to go here? All I want is to show a user control based on the button I pressed.