xml

---------------------------------------

<Page

x:Class="MyApp.MainPage"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local="using:MyApp"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

mc:Ignorable="d"

Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>

<Path HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Height="300" Stretch="Uniform" Fill="Yellow" RenderTransformOrigin="0.5,0.5">

<Path.Data>

<GeometryGroup>

<EllipseGeometry Center="50,50" RadiusX="50" RadiusY="20"/>

<EllipseGeometry Center="50,50" RadiusX="20" RadiusY="50"/>

</GeometryGroup>

</Path.Data>

<Path.RenderTransform>

<RotateTransform x:Name="rttrf" Angle="0"/>

</Path.RenderTransform>

</Path>

</Grid>

</Page>

C# code

-------------------------------------------

public sealed partial class MainPage : Page

{

Storyboard m_storyboard = null;

public MainPage()

{

this.InitializeComponent();

this.NavigationCacheMode = NavigationCacheMode.Required;

// 初始化演示图板

m_storyboard = new Storyboard();

// 定义时间线

DoubleAnimation da = new DoubleAnimation();

da.Duration = TimeSpan.FromSeconds(2d); //时间线持续时间

da.From = 0d; //初始值

da.To = 360d; //最终值

// 设置为无限循环播放

da.RepeatBehavior = RepeatBehavior.Forever;

// 将时间线与RotateTransform对象关联

Storyboard.SetTarget(da, rttrf);

Storyboard.SetTargetProperty(da, "Angle");

// 将时间线加入Storyboard的时间线集合中

m_storyboard.Children.Add(da);

}

protected override void OnNavigatedTo(NavigationEventArgs e)

{

// 开始播放动画

m_storyboard.Begin();

}

}

最新文章

  1. 让IE8在win7下面能显示使用window.showmodaldialog弹出窗口的地址状态栏
  2. Linux中设置定期备份oracle数据库
  3. chrome表单自动填充去掉input黄色背景解决方案
  4. 实例化bean的三种方式
  5. HDU 5776 sum (模拟)
  6. 源代码jar包中中文注释乱码
  7. JS call和apply用法(转)
  8. 应用程序缓存 AppCache
  9. Chapter 1 Securing Your Server and Network(3):使用托管服务帐号
  10. Git 命令速查表
  11. Openjudge-计算概论(A)-简单算术表达式求值
  12. SpringBoot简单打包部署(附工程)
  13. java 根据Url下载对应的文件到指定位置,读txt文件获取url
  14. Java 高级框架——Mybatis(一)
  15. CentOS 7 设置默认进入图形界面或文本界面
  16. pytorch做seq2seq注意力模型的翻译
  17. Ubuntu下安装open-falcon-v0.2.1
  18. ERP产品采购申请管理(三十八)
  19. 解决ORA-00257: 归档程序错误。在释放之前仅限于内部连接
  20. Python Web学习笔记之递归和迭代的区别

热门文章

  1. asp网页防止乱码
  2. endless 如何实现不停机重启 Go 程序?
  3. 简单配置nginx反向代理,实现跨域请求
  4. vue(22)Vuex的安装与使用
  5. informix 数据库锁表分析和解决方法
  6. ThreadLocal(十一)
  7. MetaBase使用iframe内嵌到Vue页面样式优化
  8. sqli-labs 靶场笔记
  9. 2019-07-06 sql备忘 连续取最大
  10. insert()与substr()函数