This seems like a fundamentally simple question. I have a WinForms dialog box with a listbox. This control is not populated via data-binding but is filled with call
This solution seems to work - in my situation, I implemented it in VB. I just created an ExtendedListbox class which inherits the listbox control, implements INotifyPropertyChanged and shadows the Items Property.
Imports System.ComponentModel
Public Class ExtendedListBox:Inherits ListBox:Implements INotifyPropertyChanged
Public Shadows Property Items() As ObjectCollection
Get
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Items"))
Return MyBase.Items
End Get
Set(value As ObjectCollection)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Items"))
MyBase.Items.Clear()
For Each o As Object In value
MyBase.Items.Add(o)
Next
End Set
End Property
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
End Class