ReorderThemeTransition 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为列表视图控件项目更改顺序的情况提供动画过渡表现方式。 通常,这是由于拖放操作造成的。 不同的控件和主题可能会对所涉及的动画具有不同的特征。
public ref class ReorderThemeTransition sealed : Transition
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ReorderThemeTransition final : Transition
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ReorderThemeTransition final : Transition
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ReorderThemeTransition : Transition
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ReorderThemeTransition : Transition
Public NotInheritable Class ReorderThemeTransition
Inherits Transition
<ReorderThemeTransition .../>
- 继承
- 属性
Windows 要求
设备系列 |
Windows 10 (在 10.0.10240.0 中引入)
|
API contract |
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
|
示例
以下示例将 ReorderThemeAnimation 应用于一组矩形。 将新矩形添加到集中时,其他矩形将围绕新矩形进行动画处理。
<StackPanel>
<Button x:Name="AddItemButton" Content="AddItem" Click="AddItemButton_Click"/>
<ItemsControl x:Name="ItemsList">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid>
<WrapGrid.ChildrenTransitions>
<!-- Apply a ReorderThemeTransition that will run when child elements are reordered. -->
<TransitionCollection>
<ReorderThemeTransition/>
</TransitionCollection>
</WrapGrid.ChildrenTransitions>
</WrapGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- Initial items. -->
<Rectangle Width="100" Height="100" Fill="Red"/>
<Rectangle Width="100" Height="100" Fill="Green"/>
<Rectangle Width="100" Height="100" Fill="Blue"/>
</ItemsControl>
</StackPanel>
private void AddItemButton_Click(object sender, RoutedEventArgs e)
{
Rectangle newItem = new Rectangle();
Random rand = new Random();
newItem.Height = 100;
newItem.Width = 100;
newItem.Fill = new SolidColorBrush(Color.FromArgb(255,
(byte)rand.Next(0, 255), (byte)rand.Next(0, 255), (byte)rand.Next(0, 255)));
// Insert a new Rectangle of a random color into the ItemsControl at index 2.
ItemsList.Items.Insert(2, newItem);
}
void DocsCppWinRT::MainPage::AddItemButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e)
{
Windows::UI::Xaml::Shapes::Rectangle newItem;
newItem.Height(100);
newItem.Width(100);
Windows::UI::Color color;
color.R = std::rand() % 256;
color.G = std::rand() % 256;
color.B = std::rand() % 256;
newItem.Fill(Windows::UI::Xaml::Media::SolidColorBrush(color));
// Insert a new Rectangle of a random color into the ItemsControl at index 2.
ItemsList().Items().InsertAt(2, newItem);
}
void DocsCPP::MainPage::AddItemButton_Click(Object^ sender,RoutedEventArgs^ e)
{
Rectangle^ newItem = ref new Rectangle();
newItem->Height = 100;
newItem->Width = 100;
Color color;
color.R = rand() % 256;
color.G = rand() % 256;
color.B = rand() % 256;
newItem->Fill = ref new SolidColorBrush(color);
// Insert a new Rectangle of a random color into the ItemsControl at index 2.
ItemsList->Items->InsertAt(2, newItem);
}
注解
请注意,设置 Duration 属性不会对此对象产生影响,因为持续时间已预配置。
构造函数
ReorderThemeTransition() |
初始化 ReorderThemeTransition 类的新实例。 |
属性
Dispatcher |
获取与此对象关联的 CoreDispatcher 。 CoreDispatcher 表示可以访问 UI 线程上的 DependencyObject 的工具,即使代码是由非 UI 线程启动的。 (继承自 DependencyObject) |
方法
ClearValue(DependencyProperty) |
清除依赖属性的本地值。 (继承自 DependencyObject) |
GetAnimationBaseValue(DependencyProperty) |
返回为依赖属性建立的任何基值,该基值适用于动画未处于活动状态的情况。 (继承自 DependencyObject) |
GetValue(DependencyProperty) |
从 DependencyObject 返回依赖属性的当前有效值。 (继承自 DependencyObject) |
ReadLocalValue(DependencyProperty) |
如果设置了本地值,则返回依赖属性的本地值。 (继承自 DependencyObject) |
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
注册通知函数,用于侦听此 DependencyObject 实例上对特定 DependencyProperty 的更改。 (继承自 DependencyObject) |
SetValue(DependencyProperty, Object) |
设置 DependencyObject 上依赖属性的本地值。 (继承自 DependencyObject) |
UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
取消以前通过调用 RegisterPropertyChangedCallback 注册的更改通知。 (继承自 DependencyObject) |