till now I have a observable collection with just one type of objects in it, but now I have second type of objects in it. I have bound some wpf elements to elements of this collection, what I now want is that the input forms change depending on which kind of object it binds to in the collection.
What is the best approach to that?
till now I have a observable collection with just one type of objects in
Share
Use a
DataTemplatewithoutx:Key, but withDataType={x:Type typename}. Write one data template for each type in your collection. WPF then automatically selects the data template that matches the type of the item in the collection.Example: