EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

EntranceThemeTransition class

Applies to Windows and Windows Phone

Provides the animated transition behavior on controls when they first appear. You can use this on individual objects or on containers of objects. In the latter case, child elements will animate into view in sequence rather than all at the same time.

Inheritance

Object
  DependencyObject
    Transition
      EntranceThemeTransition

Syntax


public sealed class EntranceThemeTransition : Transition


<EntranceThemeTransition .../>

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The EntranceThemeTransition class has these types of members:

Constructors

The EntranceThemeTransition class has these constructors.

ConstructorDescription
EntranceThemeTransition Initializes a new instance of the EntranceThemeTransition class.

 

Methods

The EntranceThemeTransition class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The EntranceThemeTransition class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

FromHorizontalOffset

Read/writeGets or sets the distance by which the target is translated in the horizontal direction when the animation is active.

FromHorizontalOffsetProperty

Read-onlyIdentifies the FromHorizontalOffset dependency property.

FromVerticalOffset

Read/writeGets or sets the distance by which the target is translated in the vertical direction when the animation is active.

FromVerticalOffsetProperty

Read-onlyIdentifies the FromVerticalOffset dependency property.

IsStaggeringEnabled

Read/writeGets or sets a value that determines whether the transition staggers rendering of multiple items, or renders all items at once.

IsStaggeringEnabledProperty

Read-onlyIdentifies the IsStaggeringEnabled dependency property.

 

Examples

The following example shows a how to apply an EntranceThemeTransition to a Button.


<Button Content="EntranceThemeTransition Button">
    <Button.Transitions>
        <TransitionCollection>
            
            <!-- This transition just uses the default behavior which is to
                 have the button animate into view from the right. You can
                 make it start from anywhere on the right by using the
                 FromHorizontalOffset property. If you'd rather see a vertical
                 animation, use the FromVerticalOffset property. -->
            <EntranceThemeTransition />
        </TransitionCollection>
    </Button.Transitions>
</Button>


The following example shows a how to apply an EntranceThemeTransition to a Button using styles.


<Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
    <Grid.Resources>
        <Style x:Key="DefaultButtonStyle" TargetType="Button">
            <Setter Property="Transitions">
                <Setter.Value>
                    <TransitionCollection>
                        <EntranceThemeTransition/>
                    </TransitionCollection>
                </Setter.Value>
            </Setter>
        </Style>
    </Grid.Resources>

    <Button Style="{StaticResource DefaultButtonStyle}" 
            Content="EntranceThemeTransition style applied" />

</Grid>


Commonly, you will want to apply the EntranceThemeTransition animation to all child elements of a panel. In this example, an EntranceThemeTransition is applied to a Grid with a bunch of child rectangles. If you run this sample, the rectangles will animate into view in sequence rather than all at the same time like when you apply the animation to individual objects.


<!-- If you set an EntranceThemeTransition animation on a panel, the
     children of the panel will automatically offset when they animate
     into view to create a visually appealing entrance. -->
<Grid HorizontalAlignment="Left">
    <Grid.ChildrenTransitions>
        <TransitionCollection>
            <EntranceThemeTransition/>
        </TransitionCollection>
    </Grid.ChildrenTransitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <!-- The sequence children appear depends on their order in 
         the panel's children, not necessarily on where they render
         on the screen. Be sure to arrange your child elements in
         the order you want them to transition into view. -->
    <Rectangle Fill="Red" Grid.Row="0" Grid.Column="0" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Blue" Grid.Row="0" Grid.Column="1" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Green" Grid.Row="0" Grid.Column="2" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Red" Grid.Row="1" Grid.Column="0" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Blue" Grid.Row="1" Grid.Column="1" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Green" Grid.Row="1" Grid.Column="2" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Red" Grid.Row="2" Grid.Column="0" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Blue" Grid.Row="2" Grid.Column="1" 
        Width="100" Height="100" Margin="2"/>
    <Rectangle Fill="Green" Grid.Row="2" Grid.Column="2" 
        Width="100" Height="100" Margin="2"/>
</Grid>


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

Transition
Animating page transitions
Guidelines and checklist for page transition animations

 

 

Mostrar:
© 2014 Microsoft. Todos os direitos reservados.