I am new to WPF, and trying to develop a small application using DataBinding following the MVVM paradigm.
I am trying to provide a binding functionality to the ObservableCollection of Documents (my type). The First Label would display a Documents path (available through Attribute property), while the next children – Pages of the Documents – would display appropriate information: page index and page content (an image).
Here is an issue – how can I create a lookup binding to a parent Label? On Button Click command I would like to pass the documents path, which was available earlier in the first DataTemplate.
Is there a way to tackle this issue?
How would you recommend going around it?
Also, is there a better way to tackle “nested” structures (collections within collections)?
Here is the code https://gist.github.com/b5760982ba81e8ee4036, line 14
you should use RelativeSource: