0

I have the three data model below:

  • DataModel1 based on DataModelBase
  • DataModel2 based on DataModelBase
  • DataModel3 with three fields:
    • Model1 type IEnumerable{DataModel1}
    • Model2 type DataModel2
    • SelectedModel type DataModelBase

I created two data templates for two types DataModel1 and DataModel2.
Now I want to create a data template for DataModel3 with a requirement as low:

  • The data template should contain a ListBox with ItemsSource bound to Model1 and Model2, the SelectedValue of the list box should be bound to SelectedModel (or Model1 or Model2).
  • The ListBoxItem that shows Model2 should align to the right of the content presenter.
  • The ListBoxItem's that shows Model1 should align to the left of the content presenter.

How can I do that?

Thien Le
  • 117
  • 2
  • 9

1 Answers1

0

Take a look at these

MSDN

StackOverflow

Community
  • 1
  • 1
lerner1225
  • 862
  • 7
  • 25