Actually i wrote a UserControl which acts as a container for other (let's call it) NestedUserControls.
I implemented a programmatically way to add such NestedUserControls to my UserControl (through an App(string name)
function). But what i actually more like would be some kind of List as a public property for my UserControl.
But the problem is, that my NestedUserControl needs to be put into the private UserControl.panel.Controls
list. Within my own written Add()
function, this is no big problem. But how can i accomplish this problem when i use the List<NestedUserControl>
property? I don't get any informations about, when the list changes in any way.
The only idea i actually found would be to create some kind of EventList<>
which throws an event whenever the list gets changed. So would this be the 'right' way or do you have any better approaches (or maybe there exists already some kind of EventList within .Net framework??
Oh, before i forget: I'm using VS2008, C#, WinForms, .Net 3.5 SP1