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

相关文章
|
6月前
|
C++
hackerrank challenges median
只能说这题我想多了,使用普通的插入排序完全可以解决这道题,在查找的时候用二分加快查找速度。 正确解题报告 这道题的关键在于,不能用int,因为两个int相加可能会越界!因为这个WA了好多遍。所以改用long long。 对double,使用math.h中的函数ceil(double)可以取整,根据ceil(v) == v的结果可以判断v是否是整数。
26 0
|
8月前
UVa11296 - Counting Solutions to an Integral Equation(枚举技巧)
UVa11296 - Counting Solutions to an Integral Equation(枚举技巧)
32 0
LeetCode 389. Find the Difference
给定两个字符串 s 和 t,它们只包含小写字母。 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母。 请找出在 t 中被添加的字母。
84 0
LeetCode 389. Find the Difference
【1096】Consecutive Factors (20 分)
【1096】Consecutive Factors (20 分) 【1096】Consecutive Factors (20 分)
98 0
【1004】Counting Leaves (30 分)
【1004】Counting Leaves (30 分) 【1004】Counting Leaves (30 分)
74 0
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
81 0
What is the difference between BTD and Q35
LeetCode之Find the Difference
LeetCode之Find the Difference
96 0