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
<ContentThemeTransition ... />
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.UI.Xaml.Media.Animation.IContentThemeTransitionStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
- WebHostHiddenAttribute()
Members
The ContentThemeTransition class has these types of members:
Constructors
The ContentThemeTransition class has these constructors.
| Constructor | Description |
|---|---|
| ContentThemeTransition | Initializes a new instance of the ContentThemeTransition class. |
Methods
The ContentThemeTransition class has these methods. It also inherits methods from the Object class.
| Method | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject) | |
| Read/write | Gets or sets the distance by which the target is translated in the horizontal direction when the transition is active. | |
| Read-only | Identifies the HorizontalOffset dependency property. | |
| Read/write | Gets or sets the distance by which the target is translated in the vertical direction when the transition is active. | |
| Read-only | Identifies 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] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012