2
votes

As many others, I started my MVVM journey by reading Josh Smith's MVVM Demo.

Using typed Data Template, he mapped every xxxViewModel to xxxView, so every time a ViewModel object is rendered, the appropriate View object is displayed. What I could not understand (nor find in the source code) is where does he actually set the Content property of the TabItem with a ViewModel?

N.B

Being new with WPF also, I am not sure my question is directly related to the MVVM pattern...

1

1 Answers

1
votes

He sets the ItemSource property of the TabControl to an observable collection of ViewModels, which he then uses the DataTemplate to link up to views. Check the section a couple of code blocks down from Figure 7. I don't think he explicitly shows that code in the example figures though.