Reacts to layout moves when no context is set and a trigger of move is passed.
Inheritance
- Object
- DependencyObject
- Transition
- RepositionThemeTransition
Syntax
<RepositionThemeTransition ../>
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
- WebHostHiddenAttribute()
Members
The RepositionThemeTransition class has these types of members:
Constructors
The RepositionThemeTransition class has these constructors.
| Constructor | Description |
|---|---|
| RepositionThemeTransition | Initializes a new instance of the RepositionThemeTransition class. |
Methods
The RepositionThemeTransition 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 RepositionThemeTransition class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject) |
Examples
The following example applies a RepositionThemeTransition to a button. When you click the button, its margin changes, which changes its position. This position change is animated.
<Button Content="Click to reposition" Click="Button_PointerPressed" x:Name="animatedButton"> <Button.Transitions> <TransitionCollection> <RepositionThemeTransition/> </TransitionCollection> </Button.Transitions> </Button>
private void Button_Clicked(object sender, RoutedEventArgs e) { animatedButton.Margin = new Thickness(100); }
A common scenario is to apply a RepositionThemeAnimation to a container of child objects. In this case, when one of the container's objects moves (or is removed/added), all the other child objects in the collection re-flow into their new positions. Click the button below to remove child objects and see how the other child elements re-flow.
<Button Content="Remove Rectangle" Click="RemoveButton_Click"/> <ItemsControl Grid.Row="1" x:Name="rectangleItems"> <ItemsControl.ItemContainerTransitions> <TransitionCollection> <!-- Without this, there would be no animation when items are removed. --> <RepositionThemeTransition/> </TransitionCollection> </ItemsControl.ItemContainerTransitions> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Height="400"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <!-- All these rectangles are just to demonstrate how the items in the grid re-flow into position when one of the child items are removed. --> <ItemsControl.Items> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> <Rectangle Fill="Red" Width="100" Height="100" Margin="10"/> </ItemsControl.Items> </ItemsControl>
private void RemoveButton_Click(object sender, RoutedEventArgs e) { if (rectangleItems.Items.Count > 0) rectangleItems.Items.RemoveAt(0); }
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