ServiceTreeコントロールに次のマークアップがありTreeView、サービスの を に表示する必要がありServiceGroupます。
<Grid>
<TreeView ItemsSource="{Binding Services}" DataContext="{Binding}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type businessService:BusinessService}">
<TreeViewItem Header="{Binding Name}"/>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid>
最上位バインディングでServicesは、 に属するサービスのコレクションですServiceGroup。
メイン ウィンドウで、次のデータ バインディングを使用してOdysseyプロジェクトOdcExpanderからを作成します。
<ItemsControl.ItemTemplate>
<DataTemplate DataType="groups:ServiceGroup">
<odc:OdcExpander Header="{Binding UIMetadata.MenuText}" HeaderBackground="{Binding UIMetadata.MenuTabBackColor}">
<XTime900Shell:ServiceTree />
</odc:OdcExpander>
</DataTemplate>
</ItemsControl.ItemTemplate>
これは機能します。それぞれに正しくバインドされた1つのエキスパンダーを取得ServiceGroupしますが、サービスを含むグループ、つまり「従業員」グループには、表示するサービスの数に高さが比例するツリービューが必要なスペースがあるため、バインドされていますコレクションプロパティ、Servicesおよび各サービスのアイテムを作成しますが、正しく入力されていることがわかっているサービスの「名前」プロパティには何も表示されません。