来自: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
  • 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的更多相关文章

  1. 关于WPF你应该知道的2000件事

    原文 关于WPF你应该知道的2000件事 以下列出了迄今为止为WPF博客所知的2,000件事所创建的所有帖子. 帖子总数= 1,201 动画 #7 - 基于属性的动画 #686 - 使用动画制作图像脉 ...

  2. 日期格式,Popup的使用方法,RenderTransform与LayoutTransform的区别

    1.画个笑脸给大家娱乐一下: <Canvas Width="200" Height="180" VerticalAlignment="Cente ...

  3. WPF Wonders: Transformations (and Robots!)

    indows Presentation Framework (WPF) gets a lot of mileage out of being layered on top of DirectX, in ...

  4. WPF学习05:2D绘图 使用Transform进行控件变形

    在WPF学习04:2D绘图 使用Shape绘基本图形中,我们了解了如何绘制基本的图形. 这一次,我们进一步,研究如何将图形变形. 例子 一个三角形,经Transform形成组合图形: XAML代码: ...

  5. WPF笔记(2.8 常用的布局属性)——Layout

    原文:WPF笔记(2.8 常用的布局属性)--Layout 这一节老没意思,啰里啰唆的尽是些HTML的属性,挑几个好玩的List出来,备忘:Padding与Margin的区别:Margin指控件边界与 ...

  6. WPF备忘录(1)有笑脸,有Popup

    1.画个笑脸给大家娱乐一下: <Canvas Width="200" Height="180" VerticalAlignment="Cente ...

  7. 【WPF学习】第五十三章 动画类型回顾

    创建动画面临的第一个挑战是为动画选择正确的属性.期望的结果(例如,在窗口中移动元素)与需要使用的属性(在这种情况下是Canvas.Left和Canvas.Top属性)之间的关系并不总是很直观.下面是一 ...

  8. Java 堆内存与栈内存异同(Java Heap Memory vs Stack Memory Difference)

    --reference Java Heap Memory vs Stack Memory Difference 在数据结构中,堆和栈可以说是两种最基础的数据结构,而Java中的栈内存空间和堆内存空间有 ...

  9. 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 ...

随机推荐

  1. DOM操作技术

    1.动态script function loadScript(url) { var script = document.createElement("script"); scrip ...

  2. Java 关键字 static

    关键字static作用如下: 1. 为某个基本数据类型或对象分配单一的存储空间. 2. 实现某个属性或方法与类关联.在类被加载后类名可以直接调用静态成员方法(下面简称静态方法)或者访问静态成员变量(下 ...

  3. 基于Two.js实现的一个小demo,星球环绕动画效果

    下面是核心js code HTML就不贴了,需要引入two.js文件: var elem = document.getElementById('draw-animation'); var two = ...

  4. Python基础-字符串、集合类型、判断、深拷贝与浅拷贝、文件读写

    字符串 1.定义三个变量: 2.交换两个变量值 1)引入第三个变量: 2)Python引入第三方变量: 3)不引入第三方变量: 3. isalpha 是否是汉字或字母 4.Isalnum  是否是汉字 ...

  5. 做了一个动态代理IP池项目,邀请大家免费测试~

    现在出来创业了,目前公司在深圳. 做了啥呢, 做了一个动态代理 IP 池项目 现在邀请大家免费测试体验! 免费激活码:关注微信公众号:2808proxy (每人每天限领一次噢~) 网站:https:/ ...

  6. 咏南中间件支持JWT TOKEN

    咏南中间件支持JWT TOKEN

  7. CSS魔法堂:Transition就这么好玩

    前言  以前说起前端动画必须使用JS,而CSS3为我们带来transition和@keyframes,让我们可以以更简单(声明式代替命令式)和更高效的方式实现UI状态间的补间动画.本文为近期对Tran ...

  8. bimgotoblock-BIM要上区块链

    比特币(BitCoin)的暴涨暴跌让参与者体验着过山车的感觉,有人一夜暴富.别墅靠海,也有人拍断大腿或者恨不得跳楼了此残生.世人也更多的听说了比特币底层的依托--区块链(BlockChain) 技术. ...

  9. go微服务框架go-micro深度学习(三) Registry服务的注册和发现

    服务的注册与发现是微服务必不可少的功能,这样系统才能有更高的性能,更高的可用性.go-micro框架的服务发现有自己能用的接口Registry.只要实现这个接口就可以定制自己的服务注册和发现. go- ...

  10. Springboot 生成验证码

    技术:springboot+kaptcha+session   概述 场景介绍 验证码,用于web网站.用户点击验证码图片后,生成验证码.提交后,用户输入验证码和Session验证码,进行校验. 详细 ...