Silverlight 5 + Prism:TabControlRegionAdapter
I had a View using a TabControl with a prism:TabControlRegionAdapter
<sdk:TabControl Grid.Row="1" AutomationProperties.AutomationId="GUID" Margin="8,8,12,12"
prism:RegionManager.RegionName="GUID_REG_NAME"
prism:RegionManager.RegionContext="{Binding CurrentSelectedItem}" Name="TabControl1" >
<prism:TabControlRegionAdapter.ItemContainerStyle>
<Style TargetType="sdk:TabItem">
<Setter Property="HeaderTemplate">
<Setter.Value>
<!--Display the child view name on the tab header-->
<DataTemplate>
<TextBlock Text="{Binding ViewName}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>开发者_如何学JAVA;
</prism:TabControlRegionAdapter.ItemContainerStyle>
</sdk:TabControl>
Everything worked fine as long as I targeted Silverlight 4.
I got the Silverlight 5 beta and changed the project's target version to SL 5.
Now the view won't compile with error:The property 'ItemContainerStyle' does not exist on the type 'TabControl' in the XML namespace 'http://www.codeplex.com/prism'
Anyone else got this error?
Any ideas about the causes/how to fix it?I had the same issue. I put the tab style into the resources section of the xaml and used the following code-behind:
TabControlRegionAdapter.SetItemContainerStyle(TabControl1, Resources["TabControl1ItemStyle"] as Style);
精彩评论