【问题标题】:Win8/XAML Sort CollectionViewSourceWin8/XAML 排序集合视图源
【发布时间】:2014-04-17 00:59:31
【问题描述】:

我正在尝试对我的 CollectionViewSource 进行排序。我已经尝试过 SortDescriptions,但是它给出了一个未知的成员错误(即使在添加了引用之后)

    <common:LayoutAwarePage.Resources>

<common:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <!--
        Collection of grouped items displayed by this page, bound to a set
        of the complete item list because items in groups cannot be virtualized
    -->
    <!--Replace d:Source... with the following to obtain data from the actual Azure Service-->
    <!--Source="{Binding ItemGroups, Source={d:DesignInstance IsDesignTimeCreatable=True, Type=ViewModels:ItemsShowcaseViewModel}}"-->
    <CollectionViewSource
        x:Name="groupedItemsViewSource"
        Source="{Binding ItemGroups}"
        d:Source="{Binding ItemGroups, Source={d:DesignInstance IsDesignTimeCreatable=True, Type=sampleData:ItemsShowcaseSampleData}}" IsSourceGrouped="True" 
        >


    </CollectionViewSource>


</common:LayoutAwarePage.Resources>

【问题讨论】:

标签: c# xaml windows-8


【解决方案1】:

排序未内置在 WinRT/XAML 中的 CollectionViewSource 中。您需要在数据/视图模型中对数据进行排序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-28
    • 2012-12-25
    • 2014-07-11
    • 1970-01-01
    • 2011-11-30
    • 2012-05-25
    • 1970-01-01
    • 2019-01-24
    相关资源
    最近更新 更多