I'm creating a user control that acts as a menu of registrations (the kind is irrelevant).
The user control is to have a collection of registrations as a property and the menu should mimic the changes in the collection.
So what I want is to somehow catch the event that the collection is changed.
This is easy when for the set property part (setting the entire collection). However it should also be possible to add individual registrations to the collection using the get part of the property, e.g. UserControl.Registrations.
, but I dont know how to catch such event.
Heres a simple code draft:
Public Class RegistrationHistoryMenu
Private _Registrations As New Dictionary(Of Integer, Registration)
Public Property Registrations As Dictionary(Of Integer, Registration)
'How do I catch changes when collection is read and then manipulated??
Set(Registrations As Dictionary(Of Integer, Registration))
_Registrations = Registrations
UpdateContent() 'Creting menu items according to collection