Disable animation for nested ContentControl

I want to disable EntrenceThemeAnimation for one of my items. I have a Grid that sets this animation for all of her children (I think this is the default for the page). Is it possible to disable this animation for ContentControl, which is a child of this grid?

I tried the following, but it does not work.

Content

<Grid Style="{StaticResource LayoutRootStyle}"> ... <!-- no animations for this element --> <ContentControl x:Name="Background" Content="Tabstagram" Margin="0" Grid.Row="1" Style="{StaticResource Background}"> <ContentControl.Transitions> <TransitionCollection/> </ContentControl.Transitions> <ContentControl.ContentTransitions> <TransitionCollection/> </ContentControl.ContentTransitions> </ContentControl> 

Styles

 <Style x:Key="LayoutRootStyle" TargetType="Panel"> <Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}"/> <Setter Property="ChildrenTransitions"> <Setter.Value> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style> <Style x:Key="Background" TargetType="ContentControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ContentControl"> <Grid> <Grid.ChildrenTransitions> <TransitionCollection/> </Grid.ChildrenTransitions> <Grid.Transitions> <TransitionCollection/> </Grid.Transitions> <Rectangle IsHitTestVisible="False" StrokeThickness="75" Margin="0" Fill="#FFC1C1C1"/> 
+4
source share
1 answer

I have the following table in the LayoutRoot table for my page, and it correctly disables the login theme transition:

 <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootStyle}"> <Grid.ChildrenTransitions> <TransitionCollection/> </Grid.ChildrenTransitions> 

Note that I am redefining the transitions for the panel using LayoutRootStyle , and I am doing this on the page, not on the resource.

Perhaps these animations flow down from the first control in which they are included, regardless of whether the child controls are disabled. You can try putting both panels at the same level in the user interface hierarchy (peers, not one nested inside the other) and see if this fixes it.

+1
source

All Articles