Sub-classing "array-like" things

By “array-like”, I mean such as segmented controls, dictionaries, listboxes, and arrays themselves.

Within a segmented control, there are segmentedControlItems. I can subclass these, and give them extra properties, which is often what I want to do. In other words, with a segmentedcontrol, its “elements” have their own separate existence. This is not the case with rows in a listbox, where I’d like to subclass a row and give it more properties. As it is, I have to do things like having zero-width columns and use the cellTag of those columns as somewhere to store extra data about the row. Equally, I’d like to subclass dictionary entries and array elements, so that each of those has extra properties.

Can I in fact do any of these things which appear impossible?

no need to subclass dictionary entries… since a dictionary is a collection of “objects”, those objects can be strings, number, or CLASSES, just build a custom class for you entry…

as for listboxes… you can assign a class to the CellTag and/or RowTag as well, and then have CellBackGroundPaint use a method of that class if you want that ability

So, nothing is impossible, it just requires thinking about it a bit differently

Thanks - some good clues there.

[quote=249574:@Tim Streater]By “array-like”, I mean such as segmented controls, dictionaries, listboxes, and arrays themselves.

Within a segmented control, there are segmentedControlItems. I can subclass these, and give them extra properties, which is often what I want to do. In other words, with a segmentedcontrol, its “elements” have their own separate existence. This is not the case with rows in a listbox, where I’d like to subclass a row and give it more properties. As it is, I have to do things like having zero-width columns and use the cellTag of those columns as somewhere to store extra data about the row.[/quote]

Yeah dont do that
Store a reference to the object that has all the properties in the rowtag then use that everywhere