Perhaps I am misunderstanding something, but if your Dictionary is read-only, you should implement a shell to make sure it is really accurate (the property of the indexed dictionary is not virtual, so you cannot override its behavior) in which you can do the following:
public class ReadOnlyDictionary<TKey, TValue> { Dictionary<TKey, TValue> innerDictionary; public virtual TValue this[TKey key] { get { return innerDictionary[key]; } private set { innerDictionary[key] = value; } } }
source share