I see that this is an old question, but I came across this when I was looking for the same thing. Perhaps others may find this answer useful in the future. There is at least one quite acceptable way to solve this problem, which is also quite simple: using bindings and using the container TabControlfor each view to bind to each tab of the ribbon.
- Connect the tape and
TabControl. SelectedIndex SelectedTabIndex.- .
:
<fluent:RibbonWindow
x:Class="FluentExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fluent="clr-namespace:Fluent;assembly=Fluent"
>
<DockPanel LastChildFill="True">
<fluent:Ribbon x:Name="_ribbon" DockPanel.Dock="Top">
<fluent:RibbonTabItem Header="Tab #1" />
<fluent:RibbonTabItem Header="Tab #2" />
</fluent:Ribbon>
<TabControl
DockPanel.Dock="Bottom"
SelectedIndex="{Binding ElementName=_ribbon, Path=SelectedTabIndex}"
>
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem><TextBlock Text="First Content View (#1)" /></TabItem>
<TabItem><TextBlock Text="Second Content View (#2)" /></TabItem>
</TabControl>
</DockPanel>
</fluent:RibbonWindow>