Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1770
swapping content with outlook bar not working
posted

Hello. I swap the content out using the <ContentControl> tag based on something click in the XamOutlookBar control. When I click on a particular OutlookBarGroup a command is sent to the view model to swap out the content in a certain part of the main window as per the code block below.

<ContentControl  Content="{Binding CurrentPageViewModel}" Grid.Column="1" />

private void OnBarGroupClick(object barGroupKey){
if (barGroupKey.ToString() == "LogsBarGroupKey"){CurrentPageViewModel = _logsViewModel;}

So when clicking on bar group everything works fine. One of the bar groups contains a tree as so:

<TreeViewItem Header="Station Reporting" Name="StationReportingTree">
<TreeViewItem Name="VariousReportsItem" Header="REPORTS"/>
</TreeViewItem>

When I click on the VariousReportsItem in the tree a command is sent to swap out the content since there will be various reports.

private void OnReportSelection(object treeViewItemName){
if (treeViewItemName != null){
if (treeViewItemName.ToString() == "VariousReportsItem"){
CurrentPageViewModel = _variousReportsViewModel;}}
}

So I can see the OnReportsSelection method being reached and the CurrentPageViewModel = _variousReportsViewModel statement gets executed but the content does not get swapped out and I have no idea why. 

I've included a sample project with this issue. Thanks.

ContentSwapExample.zip