C# 将scrollviewer添加到网格
如何将scrollviewer正确添加到此布局 我尝试将垂直滚动查看器添加到我的主网格中,但没有成功C# 将scrollviewer添加到网格,c#,xaml,C#,Xaml,如何将scrollviewer正确添加到此布局 我尝试将垂直滚动查看器添加到我的主网格中,但没有成功 <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="White" ScrollViewer.VerticalScrollBarVisibility="Auto"> <Grid.RowDefiniti
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="White" ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28"/>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Margin="12,167,8,-588" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="169*"/>
<ColumnDefinition Width="287*"/>
</Grid.ColumnDefinitions>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,21,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Search" Grid.ColumnSpan="2" ImageSource="/Assets/Apps-Magnifier-Metro-icon.png"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,21,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Grid.Column="1" Title="How It Works"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,196,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Physiotherapists" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,196,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Articles Of Week" Grid.Column="1"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,364,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Blog Of Week" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,364,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Pod Casts" Grid.Column="1"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,549,0,-111" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Jobs" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,549,0,-111" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Courses" Grid.Column="1"/>
</Grid>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="41,17,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="About Us"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="255,17,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Contact"/>
</Grid>
您的
scrollviewer
只能包含1个元素。知道您必须使网格可滚动,而不是其内容
看起来是这样的:
<ScrollViewer>
<Grid x:Name="LayoutRoot" Background="White">
//Content here
</Grid>
</ScrollViewer>
//满足于此
网格需要滚动。而不是它里面的控件