バックエンド クラスで 2 つのリストを使用しています。各リストは異なるタイプです。ユーザーに単一のリスト (両方のリストの結合を含む) を提示したいと考えています。このリスト内の項目が選択されると、その項目の詳細が表示されます。
コードは次のようになります。
私のバックエンドクラスは次のようになります
public ObservableCollection<Person> People {get;}
public ObservableCollection<Product> Products {get;}
私のXAMLは次のようになります
<ListBox x:Name="TheListBox" ItemsSource={Some Expression to merge People and Products}>
<ListBox.Resources>
People and Product Data Templates
</ListBox.Resources>
</ListBox>
...
<ContentControl Content={Binding ElementName=TheListBox, Path=SelectedItem }>
<ContentControl.Resources>
Data Templates for showing People and Product details
</ContentControl.Resources>
</ContentControl>
助言がありますか?