同时要求在http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f765d4c9-1719-4757-b467-2492d87bb4abWPF上ScaleTransform问题,多个UI元素
所有,
滚动我执行我的WPF应用程序的比例变换的滑块。现在我遇到了一个问题,其中一个具有Height =“*”的行内的scrollviewer中有一个元素,而后续行中具有Height =“Auto”的另一个元素。
目标是我们直到运行时才知道行高(或者甚至元素有多大),但是我们将在屏幕上显示这两个元素,第一个元素占用尽可能多的空间和底部元素始终可见,占用所需的任何空间。
我有以下问题/解决方案声明(我认为它最能描述我的问题),正如您所看到的,当我想要实现此目标并仍然允许访问所有UI时,我坚持要做什么元素应该足够大以将其中一个元素从屏幕上移开(希望这是有意义的)。
Problem statement:
ScaleTransform is causing top DG to disappear where RowDefinition Height="*"
Solution:
Set Minimum height on RowDefinition to prevent DG from disappearing.
Problem statement:
Setting Minimum height on RowDefinitoin causes lower rows to dissapear.
Solution:
Add scrollviewer encapsulating grid.
Problem statement:
Since top DG is in RowDefinition Height="*", if there is a lot of data in top DG, bottom DGs cannot be seen without scrolling.
Solution statement:
???
这里是我当前的代码:
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="120" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Grid.Row="0">
<DataGrid ItemsSource="{Binding Path=SomePathThatCouldHaveLotsOfData}">
<!--Note that DataGrid implements its own scrollviewer as long as it's not surrounded by another scrollviewer-->
<!--...-->
</DataGrid>
</GroupBox>
<GroupBox Grid.Row="1">
<!--...-->
</GroupBox>
希望这一切是有意义的就是我的问题是什么,我试图做的。任何想法,我可以做到这一点(希望以一种干净的方式)。如果有帮助,我使用MVVM。
编辑:我应该指出,我也不会知道任何最大高度,直到运行时间(和max-height可能无关,因为我们将使用规模转换)。