Xamarin.Forms Guides | Samples

Xamarin.Forms.ResourceDictionary Class

An IDictionary that maps identifier strings to arbitrary resource objects.

See Also: ResourceDictionary



Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,

The members of Xamarin.Forms.ResourceDictionary are listed below.

See Also: Object

Public Constructors

Creates a new empty ResourceDictionary object.

Public Properties

CountInt32. The number of entries in the ResourceDictionary.
default property
Item(String)Object. Retrieves the Object value associated with the key index.
KeysICollection<string>. The collection of identifier strings that are keys in the ResourceDictionary.
MergedDictionariesICollection<ResourceDictionary>. Gets the collection of dicionaries that were merged into this dictionary.
MergedWithType. Gets or sets the type of object with which the resource dictionary is merged.
ValuesICollection<object>. Retrieves the values of the ResourceDictionary.

Public Methods


Add an implicit Style to the ResourceDictionary. Implicit Styles are applied to all VisualElements matching TargetType in the descendants of this ResourceDictionary owner, unless a Style is explicitely applied to the Element.

Implicit Styles are added to a ResourceDictionary in XAML by not specifying an x:Key for the Element.

Add(String, Object)
Adds key and value to the ResourceDictionary as a key-value pair.
Empties the ResourceDictionary.
ContainsKey(String) : Boolean
Whether the ResourceDictionary contains a key-value pair identified by key.
GetEnumerator() : IEnumerator<KeyValuePair<string, object>>
Returns a IEnumerator`1 of the ResourceDictionary's KeyValuePair`1s.
Remove(String) : Boolean
Removes the key and value identified by key from the ResourceDictionary.
TryGetValue(String, out Object) : Boolean
Retrieves the object specified by key or, if not present, the default value of null.

Explicitly Implemented Interface Members

ResourceDictionary$ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>)Adds an item to the collection.
ResourceDictionary$ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>)Returns a value that indicates whether the dictionary contains the value in item, indexed by the key in item.
ResourceDictionary$ICollection<KeyValuePair<String,Object>>.CopyTo(KeyValuePair<String,Object>[],Int32)For internal use by the Xamarin.Forms platform.
ResourceDictionary$IEnumerable.GetEnumeratorFor internal use by the Xamarin.Forms platform.
ResourceDictionary$ICollection<KeyValuePair<String,Object>>.IsReadOnlyBoolean. Gets a value that indicates whether the resource dictionary is read-only.
ResourceDictionary$ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>)For internal use by the Xamarin.Forms platform.