ContentThemeTransition class

Applies to Windows and Windows Phone

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

Inheritance

Object
  DependencyObject
    Transition
      ContentThemeTransition

Syntax


public ref class ContentThemeTransition sealed : Transition


<ContentThemeTransition ... />

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The ContentThemeTransition class has these types of members:

Constructors

The ContentThemeTransition class has these constructors.

ConstructorDescription
ContentThemeTransition Initializes a new instance of the ContentThemeTransition class.

 

Methods

The ContentThemeTransition class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The ContentThemeTransition class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

HorizontalOffset

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

HorizontalOffsetProperty

Read-onlyIdentifies the HorizontalOffset dependency property.

VerticalOffset

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

VerticalOffsetProperty

Read-onlyIdentifies the VerticalOffset dependency property.

 

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>


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

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

Transition
Animating content transitions
Guidelines and checklist for content transition animations

 

 

Show:
© 2014 Microsoft