I have a Public Property StaticFailingPinListItem As New ObservableCollection(Of MyClass) in my main user control, UserControl1.
Public Class UserControl1
Public Property StaticFailingPinListItem As New ObservableCollection(Of MyClass)
MyClass has two properties - PinName & ImageLocation.
Public Class MyClass
Implements INotifyPropertyChanged
Public Property PinName
Public Property ImageLocation
If I manually add items to the collection at runtime, I would be able to view PinName property in my listbox. However, it doesn't work if I were to add items at a later time (eg: after a button is clicked).
This is my xaml:
ItemsSource="{Binding ElementName =data2, Path=StaticFailingPinListItem}" DisplayMemberPath="PinName"
So, the question is how I do a code-behind databinding for my listbox after the collection is populated?