Reputation: 9990
Why this doesn't work on Windows Phone 8.1 RT (no effect on header opacity):
<Pivot ItemsSource="{Binding PivotDefinition}">
<Pivot.HeaderTemplate>
<DataTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Duration="0" Storyboard.TargetName="subheader" Storyboard.TargetProperty="Opacity" To="1"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unselected">
<Storyboard>
<DoubleAnimation Duration="0" Storyboard.TargetName="subheader" Storyboard.TargetProperty="Opacity" To="0.4"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBlock x:Name="subheader" Text="{Binding Title}"/>
</Grid>
</DataTemplate>
</Pivot.HeaderTemplate>
</Pivot>
Upvotes: 0
Views: 395
Reputation: 9990
It seems that this is the bug in WP, so I skipped whole VisualStateManager and bound Opacity directly from ViewModel to subheader.
Upvotes: 0
Reputation: 21919
This is a known issue with customised Pivot Header in Windows Phone Runtime. The Silverlight 8.1 Pivot works correctly.
I'm not aware of any workarounds that would give the control you are looking for. You can override the Pivot's theme colours app-wide in the app.xaml's resources. The presenter for the header is encapsulated in the PivotHeaderPanel and so their full appearance cannot be modified in the base Pivot style outside of the HeaderTemplate you're already using (and which doesn't dim the non-selected pages when customised, as you're seeing).
--Rob
Upvotes: 1