EntranceThemeTransition EntranceThemeTransition EntranceThemeTransition EntranceThemeTransition Class

Definition

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.

public : sealed class EntranceThemeTransition : Transition, IEntranceThemeTransition
struct winrt::Windows::UI::Xaml::Media::Animation::EntranceThemeTransition : Transition, IEntranceThemeTransition
public sealed class EntranceThemeTransition : Transition, IEntranceThemeTransition
Public NotInheritable Class EntranceThemeTransition Inherits Transition Implements IEntranceThemeTransition
<EntranceThemeTransition .../>
Inheritance
EntranceThemeTransitionEntranceThemeTransitionEntranceThemeTransitionEntranceThemeTransition
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

This 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>

Here, the EntranceThemeTransition is applied using a Style resource.

<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>

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.

Here, as rectangles are added to the StackPanel, they fly in from the upper right, rather than just appearing in place.

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Button Content="Add rectangle" Click="Button_Click"/>

    <StackPanel x:Name="panel1" HorizontalAlignment="Left" Margin="200">
        <StackPanel.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition 
                FromHorizontalOffset="200" 
                FromVerticalOffset="-200"/>
            </TransitionCollection>
        </StackPanel.ChildrenTransitions>
    </StackPanel>
</Grid>
private void Button_Click(object sender, RoutedEventArgs e)
{
    // Add a rectangle to the StackPanel.
    Rectangle r = new Rectangle();
    r.Width = 100;
    r.Height = 100;

    // Alternate colors as rectangles are added.
    if (panel1.Children.Count % 2 == 0)
    {
        r.Fill = new SolidColorBrush(Colors.Green);
    }
    else
    {
        r.Fill = new SolidColorBrush(Colors.Yellow);
    }
    panel1.Children.Add(r);
}

Constructors

EntranceThemeTransition() EntranceThemeTransition() EntranceThemeTransition() EntranceThemeTransition()

Initializes a new instance of the EntranceThemeTransition class.

public : EntranceThemeTransition()
EntranceThemeTransition() const;
public EntranceThemeTransition()
Public Sub New()
See Also

Properties

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited from DependencyObject)

FromHorizontalOffset FromHorizontalOffset FromHorizontalOffset FromHorizontalOffset

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

public : double FromHorizontalOffset { get; set; }
double FromHorizontalOffset(); void FromHorizontalOffset(double fromhorizontaloffset);
public double FromHorizontalOffset { get; set; }
Public ReadWrite Property FromHorizontalOffset As double
<EntranceThemeTransition FromHorizontalOffset="double" />

Value
double double

The horizontal offset translation, in pixels.

See Also

FromHorizontalOffsetProperty FromHorizontalOffsetProperty FromHorizontalOffsetProperty FromHorizontalOffsetProperty

Identifies the FromHorizontalOffset dependency property.

public : static DependencyProperty FromHorizontalOffsetProperty { get; }
static DependencyProperty FromHorizontalOffsetProperty();
public static DependencyProperty FromHorizontalOffsetProperty { get; }
Public Static ReadOnly Property FromHorizontalOffsetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the FromHorizontalOffset dependency property.

See Also

FromVerticalOffset FromVerticalOffset FromVerticalOffset FromVerticalOffset

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

public : double FromVerticalOffset { get; set; }
double FromVerticalOffset(); void FromVerticalOffset(double fromverticaloffset);
public double FromVerticalOffset { get; set; }
Public ReadWrite Property FromVerticalOffset As double
<EntranceThemeTransition FromVerticalOffset="double" />

Value
double double

The vertical offset translation, in pixels.

See Also

FromVerticalOffsetProperty FromVerticalOffsetProperty FromVerticalOffsetProperty FromVerticalOffsetProperty

Identifies the FromVerticalOffset dependency property.

public : static DependencyProperty FromVerticalOffsetProperty { get; }
static DependencyProperty FromVerticalOffsetProperty();
public static DependencyProperty FromVerticalOffsetProperty { get; }
Public Static ReadOnly Property FromVerticalOffsetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the FromVerticalOffset dependency property.

See Also

IsStaggeringEnabled IsStaggeringEnabled IsStaggeringEnabled IsStaggeringEnabled

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

public : Platform::Boolean IsStaggeringEnabled { get; set; }
bool IsStaggeringEnabled(); void IsStaggeringEnabled(bool isstaggeringenabled);
public bool IsStaggeringEnabled { get; set; }
Public ReadWrite Property IsStaggeringEnabled As bool
<EntranceThemeTransition IsStaggeringEnabled="bool" />

Value
bool bool

true if the animation staggers rendering of multiple items. false if the animation renders all items at once.

See Also

IsStaggeringEnabledProperty IsStaggeringEnabledProperty IsStaggeringEnabledProperty IsStaggeringEnabledProperty

Identifies the IsStaggeringEnabled dependency property.

public : static DependencyProperty IsStaggeringEnabledProperty { get; }
static DependencyProperty IsStaggeringEnabledProperty();
public static DependencyProperty IsStaggeringEnabledProperty { get; }
Public Static ReadOnly Property IsStaggeringEnabledProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the IsStaggeringEnabled dependency property.

See Also

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

See Also