Xaml 虚拟化StackPanel CanVerticallyScroll属性
我正在玩Windows 8应用商店应用程序的布局,注意到Xaml 虚拟化StackPanel CanVerticallyScroll属性,xaml,windows-8,microsoft-metro,windows-runtime,windows-store-apps,Xaml,Windows 8,Microsoft Metro,Windows Runtime,Windows Store Apps,我正在玩Windows 8应用商店应用程序的布局,注意到virtualizangstackpanel.CanVerticallyScroll属性使我的应用程序崩溃,但此属性应该可以正常工作。 奇怪的是,即使Visual Studio也能正确渲染它: 我的XAML代码: <common:LayoutAwarePage x:Name="pageRoot" x:Class="App5.GroupedItemsPage" DataContext="{Binding De
virtualizangstackpanel.CanVerticallyScroll
属性使我的应用程序崩溃,但此属性应该可以正常工作。
奇怪的是,即使Visual Studio也能正确渲染它:
我的XAML代码:
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="App5.GroupedItemsPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App5"
xmlns:data="using:App5.Data"
xmlns:common="using:App5.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<CollectionViewSource
x:Name="groupedItemsViewSource"
Source="{Binding Items}"
IsSourceGrouped="false"
ItemsPath="Items"
d:Source="{Binding Items, Source={d:DesignInstance Type=data:DataGroup, IsDesignTimeCreatable=True}}"/>
</Page.Resources>
<Grid Style="{StaticResource LayoutRootStyle}">
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemGridView"
AutomationProperties.Name="Grouped Items"
ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
SelectionMode="None"
IsSwipeEnabled="false"
IsItemClickEnabled="True"
ItemClick="ItemView_ItemClick">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" CanVerticallyScroll="False"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
</Grid>
</common:LayoutAwarePage>
不完全是一个答案或解释,但如果您检查了,则该属性不应在XAML中设置。它确实在intellisense中显示,但如果您构建,它将指示找不到属性。@JimO'Neil您能推荐任何方法来实现我在上一部分中描述的目标吗?不仅仅是WrapGrid与VirtualizangStackPanel实现了您想要的目标吗?@JimO'Neil您能给出一个示例代码吗?谢谢你,换一个,看看你离这里有多近
------------
|1|4|7|10|
------------
|2|5|8|11|
------------
|3|6|9|12|
------------