I am very new to VB.NET, and I come from an Objective-C background.
In Objective-C, I could create an NSMutableDictionary which could hold any types of values.
Here with VB.NET, I managed to make a Dictionary, but when I initialized an instance of it, I am asked for a specific value type. How can I enable any value types within one single dictionary?
You can write a dictionary to hold objects like this:
And then to supply it:
This is probably not considered best programming practice. It’s better to take advantage of generics and have a dictionary hold a common class or interface of items.
Having multiple dictionaries for each class or interface of items would be more efficient and easier to maintain.