Din*_*ira 5 c# windows xaml winrt-xaml windows-store-apps
我正在尝试为Win8.1的Windows应用商店应用程序(使用C#)中的圆形路径上的文本设置动画.虽然互联网上有一些关于如何使用Silverlight和WPF进行操作的例子,但这些例子在WinRT中似乎根本不起作用(例如缺少很多方法).
在搜索解决方案时,我也发现了下面的Stackoverflow问题,但它仅适用于Windows 8.0而不适用于Windows 8.1,因此我无法使其正常工作.
如果没有从头开始重新实现所有内容,是否有任何解决方案?
小智 0
这行不通?它纯粹是一个 XAML 解决方案。故事板在加载时启动。
<Window x:Class="WpfApplication3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Storyboard x:Key="Rotate">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Label1">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Rotate}"/>
</EventTrigger>
</Window.Triggers>
<Grid>
<Label x:Name="Label1" Content="WordsAndStuff" HorizontalAlignment="Left" Margin="218.388,112.806,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.509,1.782">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Label.RenderTransform>
</Label>
</Grid>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
412 次 |
| 最近记录: |