public static object FindResource(string resource, ResourceDictionary resources, object defaultValue) { var boxedResource = resource; return(resources.HasKey(boxedResource) ? resources.Lookup(boxedResource) : defaultValue); }
object FindResourceOrNull(string resource, ResourceDictionary resources) { object boxedResource = resource; return(resources.HasKey(boxedResource) ? resources.Lookup(boxedResource) : null); }