Reputation: 14112
I have a custom control with an ObservableCollection...
In my Generic.xaml, I have the control template defined there and I would like to bind the ListBox there to the observablecollection of its own custom control (INotifyPropertyChanged implemented), which is different than normal since we're not binding to the view model.
Is this possible?
Upvotes: 1
Views: 364
Reputation: 5552
If you want to bind a control in a control template (listbox in your case) to an object in the custom control (ObservableCollection in your case), you should define the object as a dependency property in the custom control and then use 'TemplateBinding' to bind to the object in the control template.
I am however wondering if its indeed a custom control that you want and not a user control.
Upvotes: 1