Add​Delete​Theme​Transition Add​Delete​Theme​Transition Add​Delete​Theme​Transition Add​Delete​Theme​Transition Class

Definition

Provides the animated transition behavior for when controls add or delete children of a panel. For example, if you have a collection of photos displayed in a Grid, you can associate this animation to the Grid so that when photos are added or deleted, the photos will animate in and out of view.

public : sealed class AddDeleteThemeTransition : Transition, IAddDeleteThemeTransitionpublic sealed class AddDeleteThemeTransition : Transition, IAddDeleteThemeTransitionPublic NotInheritable Class AddDeleteThemeTransition Inherits Transition Implements IAddDeleteThemeTransition// This API is not available in Javascript.
<AddDeleteThemeTransition .../>
Inheritance
AddDeleteThemeTransitionAddDeleteThemeTransitionAddDeleteThemeTransitionAddDeleteThemeTransition
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties

Examples

The following example shows how to use the AddDeleteThemeTransition to animate rectangles as they are added and deleted from a panel. Notice how the other child elements of the panel re-flow when one of them is removed.

<Button Content="Add Rectangle" Click="AddButton_Click"/>
<Button Content="Remove Rectangle" Click="RemoveButton_Click"/>


<ItemsControl Grid.Row="1" x:Name="rectangleItems">
    <ItemsControl.ItemContainerTransitions>
        <TransitionCollection>

            <!-- You use AddDeleteThemeTransition 
                 in panels like in a WrapGrid. -->
            <AddDeleteThemeTransition/>
        </TransitionCollection>
    </ItemsControl.ItemContainerTransitions>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapGrid Height="400"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>

</ItemsControl>
private void RemoveButton_Click(object sender, RoutedEventArgs e)
{
    if (rectangleItems.Items.Count > 0)
        rectangleItems.Items.RemoveAt(0);
}

private void AddButton_Click(object sender, RoutedEventArgs e)
{
    Color rectColor = new Color();
    rectColor.R = 200;
    rectColor.A = 250;
    Rectangle myRectangle = new Rectangle();
    myRectangle.Fill = new SolidColorBrush(rectColor);
    myRectangle.Width = 100;
    myRectangle.Height = 100;
    myRectangle.Margin = new Thickness(10);
    rectangleItems.Items.Add(myRectangle);

}

Constructors

AddDeleteThemeTransition() AddDeleteThemeTransition() AddDeleteThemeTransition() AddDeleteThemeTransition()

Initializes a new instance of the AddDeleteThemeTransition class.

public : AddDeleteThemeTransition()public AddDeleteThemeTransition()Public Sub New()// This API is not available in Javascript.
See Also

See Also