语言

RepositionThemeAnimation 类

定义

用于对正在重新定位的对象进行动画处理。

public ref class RepositionThemeAnimation sealed : Timeline
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RepositionThemeAnimation final : Timeline
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RepositionThemeAnimation : Timeline
Public NotInheritable Class RepositionThemeAnimation
Inherits Timeline
<RepositionThemeAnimation .../>
继承
Object Platform::Object IInspectable DependencyObject Timeline RepositionThemeAnimation
属性

示例

以下示例将 RepositionThemeAnimation 应用于矩形。

<Grid>
    <Grid.Resources>
        <!-- Sets up a RepositionThemeAnimation using the FromHorizontalOffset property 
             to start the animation from the old location. -->
        <Storyboard x:Name="PointerReleasedStoryboard">
            <RepositionThemeAnimation Storyboard.TargetName="myRectangle" FromHorizontalOffset="-400"/>
        </Storyboard>
    </Grid.Resources>

    <Rectangle x:Name="myRectangle" 
         HorizontalAlignment="Left" 
         Width="200" 
         Height="200" 
         Fill="Blue"
         PointerReleased="Rectangle_PointerReleased" 
/>
</Grid>
private void Rectangle_PointerReleased(object sender, PointerRoutedEventArgs e)
{
    myRectangle.Margin = new Thickness(400, 0, 0, 0);
    PointerReleasedStoryboard.Begin();            
}
void DocsCppWinRT::MainPage::Rectangle_PointerReleased(
    Windows::Foundation::IInspectable const& /* sender */,
    Windows::UI::Xaml::Input::PointerRoutedEventArgs const& /* e */)
{
    myRectangle().Margin({ 400, 0, 0, 0 });
    PointerReleasedStoryboard().Begin();
}
void MyPage::Rectangle_PointerReleased(Object^ sender, PointerRoutedEventArgs^ e)
{
    myRectangle->Margin = Thickness(400, 0, 0, 0);
    PointerReleasedStoryboard->Begin();
}

注解

请注意,设置 Duration 属性不会影响此对象,因为预配置持续时间。

构造函数

名称 说明
RepositionThemeAnimation()

初始化 RepositionThemeAnimation 类的新实例。

属性

名称 说明
AutoReverse

获取或设置一个值,该值指示时间线在完成向前迭代后是否反向播放。

(继承自 Timeline)
BeginTime

获取或设置此 时间线 应开始的时间。

(继承自 Timeline)
Dispatcher

始终在 Windows 应用 SDK 应用中返回 null 。 请改用 DispatcherQueue 。

(继承自 DependencyObject)
DispatcherQueue

获取 DispatcherQueue 与此对象关联的对象。 表示 DispatcherQueue 即使代码是由非 UI 线程启动,也可以访问 DependencyObject UI 线程上的设施。

(继承自 DependencyObject)
Duration

获取或设置此时间线播放的时间长度,而不是计数重复。

(继承自 Timeline)
FillBehavior

获取或设置一个值,该值指定动画在其到达活动期结束时的行为方式。

(继承自 Timeline)
FromHorizontalOffset

获取或设置活动动画时目标在水平方向转换的距离。

FromHorizontalOffsetProperty

标识 FromHorizontalOffset 依赖项属性。

FromVerticalOffset

获取或设置活动动画时目标在垂直方向转换的距离。

FromVerticalOffsetProperty

标识 FromVerticalOffset 依赖项属性。

RepeatBehavior

获取或设置此时间线的重复行为。

(继承自 Timeline)
SpeedRatio

获取或设置相对于其父级的速率,此时此 时间线的进度。

(继承自 Timeline)
TargetName

获取或设置所针对的控件元素的引用名称。

TargetNameProperty

标识 TargetName 依赖项属性。

方法

名称 说明
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)

事件

名称 说明
Completed

情节提要对象已完成播放时发生。

(继承自 Timeline)

适用于

另请参阅