Love WPF! Now need to create a UserControl that shows a horizontal sequence of other UserControl.
Turns out you have to use ItemsControl for this:
- Laurent Bugnion post at http://www.galasoft.ch/mydotnet/articles/article-2007041201.aspx got me started, but in that examples his ItemsSource is ”{Binding ElementName=mainWindow, Path=DataItems}” with DataItems being an ObservableCollection<MyData> with MyData deriving from DependencyObject. This part is not what I needed.
- Surf4Fun post filled in the gap: MyData can just be any UserControl that I have created previously. On that post, Surf4Fun uses a static resource for the binding, “{Binding Source={StaticResource dataList}}”, with dataList the key to a static resource of type MyData, and MyData is ObservableCollection<MyUserControl>.
The end solution is to combine the two; this allows to make MyData an ObservableCollection<UserControl> property of my UserControl, so no need for static resources.