public static ResourceUri Create(Uri value)
 {
     ResourceUri uri;
     if (!Cache.TryGetValue(value, out uri))
     {
         uri = new ResourceUri(value);
         Cache.Add(value, uri);
     }
     return uri;
 }
 public static void SetSharedResources(ContentControl element, ResourceUri value)
 {
     element.SetValue(SharedResourcesProperty, value);
 }
 private static ResourceDictionary GetOrCreate(ResourceUri resourceUri)
 {
     ResourceDictionary rd;
     if (!SharedDictionaries.TryGetValue(resourceUri, out rd))
     {
         try
         {
             rd = (ResourceDictionary)Application.LoadComponent(resourceUri.Uri);
         }
         catch (Exception ex)
         {
             var message = string.Format("Failed loading {0}", resourceUri);
             throw new ArgumentException(message, ex);
         }
         SharedDictionaries.Add(resourceUri, rd);
     }
     return rd;
 }
 protected bool Equals(ResourceUri other)
 {
     return Uri.Equals(other.Uri);
 }