0

DataBindingを介してデータモデルからテーブルを作成したいのですが、その方法がわかりません。私はこのようなデータを持っています:

1.type CustomObj with slots:
- id
- a
- b    
2. variable Content of type <List of CustomObj>

How to make a table like as below:

+--------------------+--------------------+--------------------+
|Identifier          |a slot              |b slot              |
+--------------------+--------------------+--------------------+
|'id from first eleme|'a from first elemen|b from first elemen |
|t                   |t                   |t                   |
+--------------------+--------------------+--------------------+
|...                 |...                 |...                 |
+--------------------+--------------------+--------------------+

FlowDocumentについて読みましたが、DataBindingを介してリストからフロードキュメントを作成する方法が見つかりませんでした。

4

1 に答える 1

0

目的を達成するには、DataGridを使用します。

を作成しObservableCollection<CustomObj>、DataGridItemsSourceをこのOCにバインドします。

DataGridは次のようになります。

<DataGrid ItemsSource="{Binding CustomObjList}">
    <DataGrid.Columns>
    <DataGridTextColumn Header="Identifier" Binding="{Binding id}" />
    <DataGridTextColumn Header="a Slot" Binding="{Binding a}" />
    <DataGridTextColumn Header="b Slot" Binding="{Binding b}" />
    </DataGrid.Columns>
</DataGrid>
于 2012-10-29T10:43:42.880 に答える