官方示例使用 ContentControl。
<ContentControl s:View.Model="{Binding LeftSideBarViewModel}"
DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ContentControl s:View.Model="{Binding RightSideBarViewModel}"
DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center"/>
其实也可以这么用
<control:SideBarView s:View.Model="{Binding LeftSideBarViewModel}" DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<control:SideBarView s:View.Model="{Binding RightSideBarViewModel}" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center"/>