Tab control items and viewmodel

Topics: Conventions, Getting Started
Nov 4, 2012 at 3:38 AM

I have a tabcontrol that has some hard coded in xaml tabitems.Its all i need! The problem is that it doesnt play well with CM because it needs to be bind with a collection viewmodels. Is there a way to keep them or should i declare them at startup as a collection of viewmodels like in HelloScreens example? They have some properties like enabled=false but i guess this can be done via ItemContainerStyle.The workaround i found is to have some thing like this

<TabItem Header="Προσωπικό" Margin="0" IsSelected="True"> 
<Grid>                  
<ContentControl  cal:View.Model="{Binding YourViewModel}"  HorizontalAlignment="Stretch" Margin="50,67,50,0"  Name="ActiveItem" /> </Grid> </TabItem>
But this sets parent to nullo etc. Is there any good workaround ?