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, IContentThemeTransition
public sealed class ContentThemeTransition : Transition, IContentThemeTransition
Public NotInheritable Class ContentThemeTransition Inherits Transition Implements IContentThemeTransition
var contentThemeTransition = new contentThemeTransition();
<ContentThemeTransition ... />
Inheritance
ContentThemeTransitionContentThemeTransitionContentThemeTransitionContentThemeTransition
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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()
var contentThemeTransition = new contentThemeTransition();

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
var double = contentThemeTransition.horizontalOffset;
contentThemeTransition.horizontalOffset = double;
<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
var dependencyProperty = Windows.UI.Xaml.Media.Animation.ContentThemeTransition.horizontalOffsetProperty;

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
var double = contentThemeTransition.verticalOffset;
contentThemeTransition.verticalOffset = double;
<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
var dependencyProperty = Windows.UI.Xaml.Media.Animation.ContentThemeTransition.verticalOffsetProperty;

Dispatcher Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

Methods

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

Inherited from DependencyObject

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

Inherited from DependencyObject

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

Inherited from DependencyObject

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

Inherited from DependencyObject

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

Inherited from DependencyObject

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

Inherited from DependencyObject

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

Inherited from DependencyObject

See Also