I have this:
public static void Remove<T>(string controlID) where T: new()
{
Logger.InfoFormat("Removing control {0}", controlID);
T states = RadControlStates.GetStates<T>();
//Not correct.
(states as SerializableDictionary<string, object>).Remove(controlID);
RadControlStates.SetStates<T>(states);
}
states will always be a SerializableDictionary with string keys. The values’ type vary. Is there a way to express this? Casting to SerializableDictioanry<string, object> always yields null.
You can use the non-generic dictionary interface for this: