Do you know ObservableCollection(of Object) != ObservableCollection(of ClassA)? Of course you do. But what do you do when you have a generic collection class that you want to generalize (pardon the tone twister)? You need to do a little converter function. However, if .NET can say ObservableCollection(of ClassA) isa ObservableCollection(of Object), life will be a lot easier.
Another thing it will fix is the need to create a non-generic class as the parent type of the generic class in a class hierarchy (to ease the pain of multiple "isa" call in trying to assert the subclass' type). So you can say:
If typeof o Is GenericClass(of Object) Then
instead of
If typeof o Is GenericClassUselessParent Then
to simplify the class hierarchy.
No comments:
Post a Comment