ContentThemeTransition ContentThemeTransition ContentThemeTransition ContentThemeTransition 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// This API is not available in Javascript.
<ContentThemeTransition ... />
Inheritance
ContentThemeTransitionContentThemeTransitionContentThemeTransitionContentThemeTransition
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 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; 
}

Remarks

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

Constructors

ContentThemeTransition() ContentThemeTransition() ContentThemeTransition() ContentThemeTransition()

Initializes a new instance of the ContentThemeTransition class.

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

Properties

HorizontalOffset 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// This API is not available in Javascript.
<ContentThemeTransition HorizontalOffset="double" />
Value
double double double double

The horizontal offset translation, in pixels.

HorizontalOffsetProperty 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// This API is not available in Javascript.

VerticalOffset 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// This API is not available in Javascript.
<ContentThemeTransition VerticalOffset="double" />
Value
double double double double

The vertical offset translation, in pixels.

VerticalOffsetProperty 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// This API is not available in Javascript.

See Also