Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ResourceDictionary Class

Definition

Namespace:
Microsoft.Maui.Controls
Assembly:
Microsoft.Maui.Controls.dll
Source:
ResourceDictionary.cs
Source:
ResourceDictionary.cs
Source:
ResourceDictionary.cs
Source:
ResourceDictionary.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

A dictionary that maps identifier strings to arbitrary resource objects.

public ref class ResourceDictionary : Microsoft::Maui::Controls::Internals::IResourceDictionary, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Object ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public class ResourceDictionary : Microsoft.Maui.Controls.Internals.IResourceDictionary, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>
type ResourceDictionary = class
 interface IResourceDictionary
 interface seq<KeyValuePair<string, obj>>
 interface IEnumerable
 interface IDictionary<string, obj>
 interface ICollection<KeyValuePair<string, obj>>
Public Class ResourceDictionary
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object)), IResourceDictionary
Inheritance
ResourceDictionary
Implements

Constructors

Name Description
ResourceDictionary()

Properties

Name Description
Count

Gets the number of entries in the dictionary.

Item[String]
Keys

Gets the collection of identifier strings that are keys in the dictionary.

MergedDictionaries

Gets the collection of dictionaries that were merged into this dictionary.

Source

Gets or sets the URI of the merged resource dictionary.

Values

Gets the collection of values stored in the dictionary.

Methods

Name Description
Add(ResourceDictionary)

Adds a resource dictionary to the merged dictionaries collection.

Add(String, Object)

Adds a key-value pair to the dictionary.

Add(Style)

Adds an implicit style to the dictionary.

Add(StyleSheet)

Adds a style sheet to the dictionary.

AddFactory(String, Func<Object>, Boolean)

Adds a resource factory to the dictionary. The factory is invoked lazily when the resource is first accessed.

AddFactory(Type, Func<Style>, Boolean)

Adds an implicit style factory to the dictionary. The factory is invoked lazily when the style is first accessed.

Clear()

Removes all items from the dictionary.

ContainsKey(String)

Returns whether the dictionary contains a key-value pair identified by the specified key.

GetEnumerator()

Returns an enumerator that iterates through the dictionary's key-value pairs.

Remove(String)

Removes the key-value pair identified by the specified key.

SetAndCreateSource<T>(Uri)

For internal use by the MAUI platform.

SetAndLoadSource(Uri, String, Assembly, IXmlLineInfo)

For internal use by the MAUI platform.

TryGetValue(String, Object)

Attempts to get the value associated with the specified key.

Explicit Interface Implementations

Name Description
ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>)
ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>)
ICollection<KeyValuePair<String,Object>>.CopyTo(KeyValuePair<String,Object>[], Int32)
ICollection<KeyValuePair<String,Object>>.IsReadOnly
ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>)
IEnumerable.GetEnumerator()
IResourceDictionary.ValuesChanged

Applies to


Feedback

Was this page helpful?