I want to reuse my UserControls in other UserControls like page or window as DataTemplates, in this example inside a ListBox. Everything is MVVM.
I\'ve a UserControl
Thanks you for your answers, but I found out that my problem was another one that I had mentioned. If do it the way you described I can see my UserControls (CardControl) being used as template for the ListBox Items and the ID and the Image is displayed correctly.
Beside that I always wondered why ID and Image can be displayed while I can't bind to some other properties that I've defined in the ViewModel.
Today I found an interesting article about DataContext hierachy. There it is said that the DataContext inside a ListBox IS NOT the same DataContext as on the Page in which the ListBox is in. I didn't see that before so I thought I have to set the DataContext in some way like I mentioned in the question. Now I can bind to all properties.
Here is the article: http://blog.thekieners.com/2010/09/08/relativesource-binding-with-findancestor-mode-in-silverlight/