Windows 8 でListView と GridView


環境 Windows 8 RP + Visual Studio 2012 RC

クイック スタート: ListView コントロールと GridView コントロールの追加

 リストまたはグリッド内の項目をグループ化する方法

デフォルトでは、IsSourceGrouped=”true” となっていて、AllGroups の中身に対して列挙されます。

<CollectionViewSource
    x:Name=”groupedItemsViewSource”
    Source=”{Binding Groups}”
    IsSourceGrouped=”true”
    ItemsPath=”TopItems”
    d:Source=”{Binding AllGroups, Source={d:DesignInstance Type=data:RssDataSource, IsDesignTimeCreatable=True}}”/>

image

これを一段上のAllGroup に対して列挙したい場合は、IsSourceGrouped を false に設定します。

protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
    var sampleDataGroups = RssDataSource.GetGroups(“AllGroups”);
    this.DefaultViewModel[“Groups”] = sampleDataGroups;
}

<CollectionViewSource
    x:Name=”groupedItemsViewSource”
    Source=”{Binding Groups}”
    IsSourceGrouped=”false”
    ItemsPath=”TopItems”
    d:Source=”{Binding AllGroups, Source={d:DesignInstance Type=data:RssDataSource, IsDesignTimeCreatable=True}}”/>

image

難しい・・・

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中


%d人のブロガーが「いいね」をつけました。