Content​Theme​Transition Content​Theme​Transition Content​Theme​Transition Class

Definition

Provides the animated transition behavior for when the content of a control is changing. This might be applied in addition to AddDeleteThemeTransition.

public sealed class ContentThemeTransition : Transition, IContentThemeTransitionpublic sealed class ContentThemeTransition : Transition, IContentThemeTransitionPublic NotInheritable Class ContentThemeTransition Inherits Transition Implements IContentThemeTransition
<ContentThemeTransition ... />
Inheritance
ContentThemeTransitionContentThemeTransitionContentThemeTransition
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

Remarks

Note that setting the Duration property has no effect on this object since the duration is preconfigured.

Examples

The following example applies a ContentThemeAnimation to a rectangle.


<!-- The ContentThemeTransition will execute when the ContentControl’s content changes. -->        
<ContentControl x:Name="ContentHost" PointerPressed="ContentHost_PointerPressed">
    <ContentControl.ContentTransitions>
        <TransitionCollection>
            <ContentThemeTransition/>
        </TransitionCollection>
    </ContentControl.ContentTransitions>
    <Rectangle Height="200" Width="200" Fill="Orange"/>
</ContentControl>
private void ContentHost_PointerPressed(object sender, PointerRoutedEventArgs e)
{
    // Replace the ContentControl's content with a new Rectangle of a random color.
    Rectangle newItem = new Rectangle();
    Random rand = new Random();

    newItem.Height = 200;
    newItem.Width = 200;
    newItem.Fill = new SolidColorBrush(Color.FromArgb(255, 
         (byte)rand.Next(0, 255), (byte)rand.Next(0,255), (byte)rand.Next(0, 255)));

    ContentHost.Content = newItem; 
}
void MyPage::ContentHost_PointerPressed(Object^ sender, PointerRoutedEventArgs^ e)
{
    // Replace the ContentControl's content with a new Rectangle of a random color.
    Rectangle^ newItem = ref new Rectangle();

    newItem->Height = 200;
    newItem->Width = 200;

    Color color;
    color.R = rand() % 256;
    color.G = rand() % 256;
    color.B = rand() % 256;

    newItem->Fill = ref new SolidColorBrush(color);

    ContentHost->Content = newItem; 
}

Constructors

ContentThemeTransition() ContentThemeTransition() ContentThemeTransition()

Initializes a new instance of the ContentThemeTransition class.

public ContentThemeTransition()public ContentThemeTransition()Public Sub New()
Attributes

Properties

HorizontalOffset HorizontalOffset HorizontalOffset

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

public double HorizontalOffset { get; set; }public double HorizontalOffset { get; set; }Public ReadWrite Property HorizontalOffset As double
<ContentThemeTransition HorizontalOffset="double" />
Value
double double double

The horizontal offset translation, in pixels.

Attributes

HorizontalOffsetProperty HorizontalOffsetProperty HorizontalOffsetProperty

Identifies the HorizontalOffset dependency property.

public static DependencyProperty HorizontalOffsetProperty { get; }public static DependencyProperty HorizontalOffsetProperty { get; }Public Static ReadOnly Property HorizontalOffsetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the HorizontalOffset dependency property.

Attributes

VerticalOffset VerticalOffset VerticalOffset

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

public double VerticalOffset { get; set; }public double VerticalOffset { get; set; }Public ReadWrite Property VerticalOffset As double
<ContentThemeTransition VerticalOffset="double" />
Value
double double double

The vertical offset translation, in pixels.

Attributes

VerticalOffsetProperty VerticalOffsetProperty VerticalOffsetProperty

Identifies the VerticalOffset dependency property.

public static DependencyProperty VerticalOffsetProperty { get; }public static DependencyProperty VerticalOffsetProperty { get; }Public Static ReadOnly Property VerticalOffsetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the VerticalOffset dependency property.

Attributes

See Also