Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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 sealed class ContentThemeTransition : 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>


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

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