我有一个视图,它是“DataViewModels”中的多个视图之一。我必须使scrollviewer可见并在调整UsercontrolView时滚动。我尝试在Grid外面添加一个具有一定高度的scrollviewer,但它并没有按预期滚动...我很高兴将一个scrollviewer添加到MySampleWindowView的正确方法是它与分辨率无关。 / p>
以下是代码:
<views:UserControlView x:Class="XYZ.DataViewModels.MySampleWindow.MySampleWindowView"
xmlns:views="clr-namespace:XYZ.Views"
d:DesignHeight="600"
d:DesignWidth="600">
<UserControl.Resources />
<Border BorderThickness="1"
BorderBrush="Gray"
x:Name="RootElement">
<Grid Background="{DynamicResource DataViewColor}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row = "0"/>
<GroupBox Grid.Row = "1"/>
<GroupBox Grid.Row = "2"/>
</Grid>
</Border>
</views:UserControlView>