[UWP] [C#]使用C#进行Canvas动画 [英] [UWP][C#]Animation of Canvas using C#

查看:658
本文介绍了[UWP] [C#]使用C#进行Canvas动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 - 我正在开发一个UWP应用程序,需要在运行时(如果/需要的话)以两种方式设置在C#中创建的Canvas的动画。我可以找到很多信息来实现这一点,使用XAML,但没有(对于C#

Hi - I am developing a UWP app and need to animate a Canvas that is created in C# during runtime (if / when needed) in two ways. I can find plenty of info to achieve this using XAML but nothing (that works) for C#

1)我希望将myCanvas水平移动到屏幕之间(X1和X2可以说)并动画这一举动。仅使用C#代码实现此目的的最佳方法是什么?

1) I would like to move myCanvas horizontally across the screen between (X1 and X2 lets say) and animate this move. What is the best way to achieve this using C# code only?

2)我想增加myCanvas的高度(并再次减小)以显示height和height2之间的一些额外信息,再次,我想使用C#代码为此设置动画。

2) I would like to increase the height (and decrease again) of myCanvas to reveal some extra info between height and height2, again I would like to animate this using C# code.

任何帮助将不胜感激。谢谢!

Any help would be greatly appreciated. Thank you!

推荐答案

您下载了UWP样本吗?请参阅
Windows 10 Universal App Samples | Coding4Fun博客|第9频道
。另请参阅
代码示例 - Windows应用程序开发
Have you downloaded the UWP samples? See Windows 10 Universal App Samples | Coding4Fun Blog | Channel 9. Also see Code samples - Windows app development.


这篇关于[UWP] [C#]使用C#进行Canvas动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆