internal DeferredResourceReference(ResourceDictionary dictionary, object key)
 {
     this.dictionary = dictionary;
     this.keyOrValue = key;
 }
 internal virtual void RemoveFromDictionary()
 {
     if (this.dictionary != null)
     {
         this.dictionary.DeferredResourceReferences.RemoveAll(r => r.Target == this);
         this.dictionary = null;
     }
 }