转:The Difference Between a LayoutTransform and a RenderTransform
来自:http://www.tuicool.com/articles/fIfm22
#770 – The Difference Between a LayoutTransform and a RenderTransform
March 6, 2013 Leave a comment
When you are transforming user interface elements using a 2D transform, you can choose one of two types of transforms.
- A LayoutTransform transforms elements before they are layed out by the parent panel
- A RenderTransform transforms element after they are layed out by the parent panel (but before they are rendered)
Which one you use depends on whether you want transform and then lay out (useLayoutTransform ) or to lay out and then transform (use RenderTransform ). (Note: You could also use both types).
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Vertical"> <Label Content="LayoutTransform"/> <Button Content="Push Me" Style="{StaticResource buttonStyle}"/> <Button Content="Push Me" Style="{StaticResource buttonStyle}"> <Button.LayoutTransform> <RotateTransform Angle="20"/> </Button.LayoutTransform> </Button> <Button Content="Push Me" Style="{StaticResource buttonStyle}"> <Button.LayoutTransform> <RotateTransform Angle="-20"/> </Button.LayoutTransform> </Button> </StackPanel> <StackPanel Orientation="Vertical"> <Label Content="RenderTransform"/> <Button Content="Push Me" Style="{StaticResource buttonStyle}"/> <Button Content="Push Me" Style="{StaticResource buttonStyle}"> <Button.RenderTransform> <RotateTransform Angle="20"/> </Button.RenderTransform> </Button> <Button Content="Push Me" Style="{StaticResource buttonStyle}"> <Button.RenderTransform> <RotateTransform Angle="-20"/> </Button.RenderTransform> </Button> </StackPanel> </StackPanel>

转:The Difference Between a LayoutTransform and a RenderTransform的更多相关文章
- 关于WPF你应该知道的2000件事
原文 关于WPF你应该知道的2000件事 以下列出了迄今为止为WPF博客所知的2,000件事所创建的所有帖子. 帖子总数= 1,201 动画 #7 - 基于属性的动画 #686 - 使用动画制作图像脉 ...
- 日期格式,Popup的使用方法,RenderTransform与LayoutTransform的区别
1.画个笑脸给大家娱乐一下: <Canvas Width="200" Height="180" VerticalAlignment="Cente ...
- WPF Wonders: Transformations (and Robots!)
indows Presentation Framework (WPF) gets a lot of mileage out of being layered on top of DirectX, in ...
- WPF学习05:2D绘图 使用Transform进行控件变形
在WPF学习04:2D绘图 使用Shape绘基本图形中,我们了解了如何绘制基本的图形. 这一次,我们进一步,研究如何将图形变形. 例子 一个三角形,经Transform形成组合图形: XAML代码: ...
- WPF笔记(2.8 常用的布局属性)——Layout
原文:WPF笔记(2.8 常用的布局属性)--Layout 这一节老没意思,啰里啰唆的尽是些HTML的属性,挑几个好玩的List出来,备忘:Padding与Margin的区别:Margin指控件边界与 ...
- WPF备忘录(1)有笑脸,有Popup
1.画个笑脸给大家娱乐一下: <Canvas Width="200" Height="180" VerticalAlignment="Cente ...
- 【WPF学习】第五十三章 动画类型回顾
创建动画面临的第一个挑战是为动画选择正确的属性.期望的结果(例如,在窗口中移动元素)与需要使用的属性(在这种情况下是Canvas.Left和Canvas.Top属性)之间的关系并不总是很直观.下面是一 ...
- Java 堆内存与栈内存异同(Java Heap Memory vs Stack Memory Difference)
--reference Java Heap Memory vs Stack Memory Difference 在数据结构中,堆和栈可以说是两种最基础的数据结构,而Java中的栈内存空间和堆内存空间有 ...
- What's the difference between a stub and mock?
I believe the biggest distinction is that a stub you have already written with predetermined behavio ...
随机推荐
- 第一篇随笔 - Hello world!
第一篇随笔 - Hello world! 第一篇随笔 - Hello world! 第一篇随笔 - Hello world! 第一篇随笔 - Hello world! 第一篇随笔 - Hello wo ...
- Flask jinja2
{{ }} #引用 执行 非逻辑代码 {% %} #逻辑代码 引用变量 @app.template_global() # 全局函数 Markup # 安全标签字符串儿 {% macro func() ...
- C#数组,ArrayList,List
一.数组声明方式 1,声明一个未经初始化的数组引用,以后可以把这引用初使化为一个数组实例 int[] int_array; int_array = new int[2]; 注:数组的引用必须以相同或相 ...
- iOS 开开中textfield的一些记录
1.placehold 使用KVC机制改变占位符的颜色和大小 [textField setValue:[UIColor redColor] forKeyPath:@"_placeholder ...
- 轻量对象存储服务——minio
minio Minio是一个非常轻量的对象存储服务. Github: minio 它本身不支持文件的版本管理.如果有这个需求,可以用 s3git 搭配使用. Github: s3git 安装 mini ...
- JSAP106
JSAP106 一.clientX.clientY 点击位置距离当前body可视区域的x,y坐标 二.pageX.pageY 对于整个页面来说,包括了被卷去的body部分的长度 三.screenX.s ...
- tk.mybatis通用插件updateByPrimaryKeySelective无法自动更新ON UPDATE CURRENT_TIMESTAMP列的解决办法
tk.mybatis是一个很好用的通用插件,把CRUD这些基本的数据操作全都用动态SQL语句自动生成了,mapper和xml里十分清爽,但是昨天发现有一个小坑,记录在此: 有一张表,结构如下(已经简化 ...
- html的文字样式、下行线、删除线、上标、下标等实现方式
先看效果如下: 代码如下: <del>del标签删除线</del><br/> <strike>strike标签删除线</strike>< ...
- C#异步Task编程模型实战手册
一.课程介绍 本次分享课程属于<C#高级编程实战技能开发宝典课程系列>中的第一部分,阿笨后续会计划将实际项目中的一些比较实用的关于C#高级编程的技巧分享出来给大家进行学习,不断的收集.整理 ...
- ASP.NET Core使用Razor页面
ASP.NET Core使用Razor页面 Razor是ASP.NET的页面引擎,在ASP.NET MVC 3以后被广泛使用,我在之前的博客中有所介绍,需要更多了解的朋友请移步[Razor语法] 在A ...