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

相关文章
|
8月前
codeforces 347A - Difference Row
给你一个序列,让你求(x1 - x2) + (x2 - x3) + ... + (xn - 1 - xn).值最大的一个序列,我们化简一下公式就会发现(x1 - x2) + (x2 - x3) + ... + (xn - 1 - xn). = x1 - xn, 也就是说只有第一个和最后一个是确定的,其他的随便了! 也不是了, 还要让你按字典序最小的排列,也就是说其他的是按飞递减序排列的,简单的一次排序就OK了。
22 0
LeetCode 389. Find the Difference
给定两个字符串 s 和 t,它们只包含小写字母。 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母。 请找出在 t 中被添加的字母。
89 0
LeetCode 389. Find the Difference
LeetCode 153. Find Minimum in Rotated Sorted Array
假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] )。 请找出其中最小的元素。 你可以假设数组中不存在重复元素。
88 0
LeetCode 153. Find Minimum in Rotated Sorted Array
Difference between RawValue and FormattedValue
Difference between RawValue and FormattedValue
Difference between RawValue and FormattedValue
What is the difference between BTD and Q35
Created by Wang, Jerry, last modified on Dec 12, 2014
87 0
What is the difference between BTD and Q35
LeetCode之Find the Difference
LeetCode之Find the Difference
103 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...
1507 0