Xamarin.Forms Guides | Samples

Xamarin.Forms.ResourceDictionary Class

An IDictionary that maps identifier strings to arbitrary resource objects.

See Also: ResourceDictionary

Syntax

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

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

See Also: Object

Public Constructors

Creates a new empty ResourceDictionary object.

Public Properties

[read-only]
CountInt32. The number of entries in the ResourceDictionary.
default property
Item(String)Object. Retrieves the Object value associated with the key index.
[read-only]
KeysICollection<string>. The collection of identifier strings that are keys in the ResourceDictionary.
MergedWithType.
[read-only]
ValuesICollection<object>. Retrieves the values of the ResourceDictionary.

Public Methods

Add(Style)

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.
Clear()
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)Copies the values in the dictionary to array, starting at position arrayIndex in array.
ResourceDictionary$IEnumerable.GetEnumeratorReturns a IEnumerator of the ResourceDictionary's KeyValuePair`1s.
[read-only]
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>)Removes the value in item, indexed by the key in item, from the dictionary, if present.