来自: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. js加密php解密---jsencrypt

    原理:javascript加密PHP解密: 完全依赖openssl: 一. openssl 是干嘛的 它集成了众多密码算法及实用工具 rsa加密流程:(今天只讲众多加密方式中的一种) 1. 在当前文件 ...

  2. Egret 按钮点击缩放效果

    非代码设计,exml直接操作 设计模式下选中对象,之后[源码],会直接定位到该对象在exml源码中的位置 width.down = "100%" 表示当按钮按下的时候宽度为 100 ...

  3. Unity安装破解

    最近,电脑重新安装的系统,然后的然后就是软件之类的都要重新安装 一.在unity官网下载对应版本对应系统,之后双击下载得到的.exe可执行文件. 二.选择对应的包和引擎安装的本地路径,等待安装完成. ...

  4. Html链接标签:

    <a>标签可以在网页上定义一个链接地址,它的常用属性有: (1)href属性 定义跳转的地址 (2)title属性 定义鼠标悬停时弹出的提示文字框 (定义鼠标悬停时,弹出的提示框中的文字) ...

  5. fixed和sticky

    <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>f ...

  6. Aizu0189 Convenient Location(多源最短路)

    https://vjudge.net/problem/Aizu-0189 题意:求某一点到其他所有点的最短路径之和,输出该点与和. 注意Floyd可以求多源最短路径,而Dijkstra只能求单源. # ...

  7. django之模型层(model)--多表相关操作(图书管理小练习)

    前面几篇随笔的数据库增删改查操作都是在单表的操作上的,然而现实中不可能都是单表操作,更多的是多表操作,一对一,一对多,多对多的表结构才是我们经常需要处理的,本篇将带我们了解多表操作的一些相关操作.也会 ...

  8. 360se打开慢,lsass 过高 , cpu温度上升

    rd /s /q "%AppData%\Roaming\Microsoft\Protect" rem C:\Users\Administrator\AppData\Roaming\ ...

  9. 修复恢复"可疑"的SQLServer数据库

    今天机房突然断电,DB连不上了,提示 无法打开数据库'MyDB'.恢复操作已将该数据库标记为 SUSPECT. 原因是断电导致DB文件损坏 通过SQL Server Management Studio ...

  10. 修改Arduino IDE默认字体

    文件->首选项 点击直接编辑下面那个文件 修改editor.font这个条目就可以不用那么毁眼了..