Quote Originally Posted by Arjay View Post
What I've done in this situation is to use a tabcontrol with hidden tabs. As a user makes a 'view' selection, the SelectedIndex of the TabControl is changed and a different view is displayed.

For example, the following code has the ability to display 3 different views:

First let's declare the 'hidden' tab control style:
Code:
<Window.Resources>
	<Style x:Key="HiddenTabItemStyle" TargetType="{x:Type TabItem}">
		<Setter Property="Visibility" Value="Hidden"/>
		<Setter Property="Margin" Value="0"/>
	</Style>
	<Style x:Key="HiddenTabStyle" TargetType="{x:Type TabControl}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Margin" Value="0,-15,0,0"/>
	</Style>
</Window.Resources>
Next use the tabstyles in a tabcontrol that contains 3 different views
Code:
<TabControl x:Name="_viewContainer"
	SelectedIndex="{Binding Path=ViewModeId}"
	Background="Transparent"
	Style="{StaticResource HiddenTabStyle}" 	BorderBrush="Transparent" >
	<TabItem Background="Transparent" Style="{StaticResource HiddenTabItemStyle}">
		<acc:AutomaticView x:Name="_automaticView" />
	</TabItem>
	<TabItem Background="Transparent" Style="{StaticResource HiddenTabItemStyle}">
		<acc:EditView x:Name="_editView" />
	</TabItem>
	<TabItem Background="Transparent" Style="{StaticResource HiddenTabItemStyle}">
		<acc:ManualView x:Name="_manualView" />
	</TabItem>
</TabControl>
In the above code, when the ViewModeId property changes, the new view gets loaded.
Arjay,

Thanks for the reply. So, this is simply to change the views correct? How do you create the views to show? Do you use a UserControl or form without border, or....

Also, I think I have found another solution as well, ProjectTrackers from CSLA library. Not yet sure which is the better of the two..... In that sample he:

1) Places a DockPanel on the main window.
2) Uses a list box with items (TextBlock) as the menu.
3) In the AXML he attaches (?) a hyperlink which points to a delegate in the main window .cs file.
4) This delegate then clears the DockPanel and shows the appropriate view.

The views in this sample are UserControl objects. Just thought you may have 2 cents to put in regarding this method.

Thanks again,

Mike B