私はWPFに非常に慣れていないので、助けていただければ幸いです:
Model:
Collection<Presenter>,
Presenter has a Collection<Presentation>,
Presentation has a TeachingSession property (which contains a DateTime? property)
ツリービュー表示をしようとしています:
presenter name
[combobox of available Dates]
現時点では、ツリービューの各発表者名は正しく表示されており、展開された最初の親アイテムには正しく選択された日付のコンボボックスが表示されます。ただし、一度に表示されるコンボボックスはすべて「同期」しています。つまり、コンボボックスの値を変更する (または別のツリービュー項目を展開する) と、表示可能なすべてのコンボボックスの値が変更されるため、すべて同じ日付が表示されます。
<TreeView Name="PresenterTreeView" ItemsSource="{Binding}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:Presenter}"
ItemsSource="{Binding Path=Presentations}">
<TextBlock Text="{Binding Path=FullName}" />
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:Presentation}">
<ComboBox SelectedItem="{Binding Path=TeachingSession, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="SessionDate"
ItemsSource="{Binding Source={StaticResource availableDatesViewSource}}" >
</ComboBox>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>