转: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 ...

来自: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>

770-001

相关文章
UVa11296 - Counting Solutions to an Integral Equation(枚举技巧)
UVa11296 - Counting Solutions to an Integral Equation(枚举技巧)
51 0
LeetCode 389. Find the Difference
给定两个字符串 s 和 t,它们只包含小写字母。 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母。 请找出在 t 中被添加的字母。
121 0
LeetCode 389. Find the Difference
LeetCode 39. Combination Sum
给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。 candidates 中的数字可以无限制重复被选取。
74 0
LeetCode 39. Combination Sum
Leetcode-Easy 977. Squares of a Sorted Array
Leetcode-Easy 977. Squares of a Sorted Array
97 0
LeetCode之Find the Difference
LeetCode之Find the Difference
120 0
|
开发者
Intersection between a 2d line and a conic in OpenCASCADE
Intersection between a 2d line and a conic in OpenCASCADE eryar@163.com Abstract. OpenCASCADE provides the algorithm to implementation of the analy...
1533 0
|
机器学习/深度学习
Intersection between 2d conic in OpenCASCADE
Intersection between 2d conic in OpenCASCADE eryar@163.com   Abstract. OpenCASCADE provides the algorithm to implement of the intersection between two 2d conic curve.
1400 0
|
算法
OpenCASCADE 3 Planes Intersection
OpenCASCADE 3 Planes Intersection eryar@163.com Abstract. OpenCASCADE provides the algorithm to search the intersection point between 3 planes. If two of the planes are parallel or identical, will get no result. Key Words. Plane Intersection 1.Introduction 由《高等数学》可知,如果一非零向量垂直于一平面,这向量就叫做该平面的法向量。
1302 0