コード例 #1
0
        public static object FindResource(string resource, ResourceDictionary resources, object defaultValue)
        {
            var boxedResource = resource;

            return(resources.HasKey(boxedResource) ? resources.Lookup(boxedResource) : defaultValue);
        }
コード例 #2
0
        object FindResourceOrNull(string resource, ResourceDictionary resources)
        {
            object boxedResource = resource;

            return(resources.HasKey(boxedResource) ? resources.Lookup(boxedResource) : null);
        }