UWP 动画
一:StoryBoard
一般翻译成演示图版或者故事板,就像电影中的情节串联板,它是一个动画时间线的容器。
二:动画的分类
简单动画:以Animation结尾,例如DoubleAnimation
关键帧动画:以AnimationUsingKeyFrames结尾
简单动画主要是定义两个值,一个起点,一个终点,在两个值之间生成动画,可以用来满足简单的动画需求。
关键帧动画更好理解,你可以像flash里一样,通过不同的关键帧来定义动画。这样做的动画会比简单动画来的细致一些。
三:VisualState
在上一篇中,通过编辑模板vs会自动生成一个对应控件的Style。我们可以在VisualStateManager里改一下不同状态下的控件样式。
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" From="" To="0.1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Mask" ></DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" From="0.2" To="" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Mask" ></DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" From="0.2" To="" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Mask" ></DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Fill="{TemplateBinding Background}"></Ellipse>
<ContentPresenter x:Name="ContentPresenter"
AutomationProperties.AccessibilityView="Raw"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Ellipse Name="Mask" Fill="Black" Opacity="0.1"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
每一个VisualState代表一个状态。Normal默认状态,PointerOver鼠标移上状态,Pressed鼠标安按下状态,Disabled不可用状态
通过简单动画DoubleAnimation来定义一些简单的动画。
---some words---
1.StoryBoard:故事板
-----the end-------
UWP 动画的更多相关文章
- win10 UWP 动画
原文:win10 UWP 动画 本文告诉大家如何写同一个简单的动画. 动画入门 本文开始写一个简单的动画,只是移动矩形作为本文的例子. 在 UWP 移动元素的动画,可以使用 RenderTransfo ...
- UWP 动画系列之模仿网易云音乐动画
一.前言 最近在弄毕业设计(那时坑爹选了制作个UWP商店的APP),一个人弄得烦躁,在这里记录一些在做毕业设计时的学习过程.由于我的毕业设计是做一个音乐播放器,那么Windows商店上优秀的软件当然是 ...
- uwp 动画Storyboard
代码如下: <Page.Resources> <Storyboard x:Name="storyboard"> < ...
- uwp 动画之圆的放大与缩小
xml code --------------------------------------------------- <Page x:Class="MyApp.MainPage&q ...
- UWP 动画之路径
xml --------------------------------------------- <Page x:Class="MyApp.MainPage" xmlns= ...
- [UWP小白日记-6]页面跳转过度动画
前言 在学习中发现页面导航默认是没有过度动画的,直接就导航过去太粗暴了( ̄へ ̄),于是打算上动画结果不言而喻自己进了坑完全不懂动画,然后就是各种疯狂(´・_・`)的搜索资料看了后终于有点头绪. 再后来 ...
- win10 uwp 异步进度条
本文主要讲我设计的几个进度条,还有如何使用异步控制进度条,如何使用动画做进度. 进度条可以参见:http://edi.wang/post/2016/2/25/windows-10-uwp-modal- ...
- dotnet 从入门到放弃的 500 篇文章合集
本文是记录我从入门到放弃写的博客 博客包括 C#.WPF.UWP.dotnet core .git 和 VisualStudio 和一些算法,所有博客使用 docx 保存 下载:dotnet 从入门到 ...
- 2018-2-13-win10-UWP-动画
title author date CreateTime categories win10 UWP 动画 lindexi 2018-2-13 17:23:3 +0800 2018-2-13 17:23 ...
随机推荐
- IE浏览器部分版本不支持background-size属性问题
background-size是CSS3新增的属性,但是IE8以下还是不支持,可以通过滤镜来实现这样的一个效果 background-size:contain; // 缩小图片来适应元素的尺寸(保持像 ...
- python的pexpect模块
Pexpect 是 Don Libes 的 Expect 语言的一个 Python 实现,是一个用来启动子程序,并使用正则表达式对程序输出做出特定响应,以此实现与其自动交互的 Python 模块. P ...
- 使用外部 toolchain 编译 openwrt
默认编译 openwrt 时会先编译一套 toolchain. 这个步骤耗时较长. 使用外部 toolchain 可以多个 project 共用一套 toolchain , 而且也不重再编译它了. 省 ...
- directdraw 显示yuv
http://www.cnblogs.com/lidan/archive/2012/03/23/2413772.html http://www.yirendai.com/msd/
- HDU 6096 String 排序 + 线段树 + 扫描线
String Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Problem De ...
- 基于Ubuntu 14.04 LTS编译Android4.4.2源码
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/gobitan/article/details/24367439 基于Ubuntu 14.04 LTS ...
- searchkick HasMany Associations | index related model fields
Project < ActiveRecord::Base searchkick has_many :categories_has_projects has_many :categories, t ...
- Android源代码下载过程中无法下载repo的解决方法【转】
本文转载自:http://blog.csdn.net/shangyuan21/article/details/17618575 我们都知道下载Android源代码需要使用repo进行辅助下载,但是最进 ...
- svn服务器搭建与迁移
2016-11-21更新: 今天被svn的钩子搞了半天,网上找解决方法都无效,下午被我试出来了,特此记录. 在svn的钩子中可以使用update来更新配置文件,比如ansible的,puppet的,具 ...
- zoj 1109 Language of FatMouse 解题报告
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=109 题目意思:给出一个mouse-english词典,问对于输入的m ...