是否可以在我的metro应用程序的XAML代码中指定CollectionViewSource元素
<CollectionViewSource x:Name="groupedAppointments" IsSourceGrouped="True"
d:Source="{Binding Appointments,
Source={d:DesignInstance Type=dataModel:SampleDataSource,
IsDesignTimeCreatable=True}}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="@DateOfVisit" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
但VS说
Error 3 The member "GroupDescriptions" is not recognized or is not accessible.
根据msdn,CollectionViewSource应该有这个字段。 我做错了什么?
答案 0 :(得分:0)
以下是winrt的CollectionViewSource的文档页面:http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.data.collectionviewsource.aspx
GroupDescriptions 属性在WinRT中不可用
如果我没记错的话,这对你有用:
<CollectionViewSource x:Name="groupedAppointments" IsSourceGrouped="True"
ItemsPath="ThePropertyThatIsGroupedByDateOfVisitGoesHere"
d:Source="{Binding Appointments,
Source={d:DesignInstance Type=dataModel:SampleDataSource,
IsDesignTimeCreatable=True}}">
</CollectionViewSource>