基本上,我有一个FooControl
(我没有而不是明确设置高度/宽度)添加到Grid
。WPF转换 - 旋转和切换宽度/高度?
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<FooControl x:Name="HWFoo" Content="HelloWorld" Grid.Row="0">
<FooControl.RenderTransform>
<TransformGroup>
<RotateTransform Angle="270" />
<TranslateTransform Y="{Binding ActualWidth, ElementName=HWFoo}" />
</TransformGroup>
</FooControl.RenderTransform>
</FooControl>
</Grid>
但是,现在的问题是,FooControl填满整个行,当它转化看起来很奇怪的(因为它的高度/宽度)。
FooControl是一个自定义控件。那么我应该使用ArrangeOverride还是MeasureOverride?或者我做了一些可以在XAML中修复的错误。