ResourceDictionary 类

定义

可将标识符字符串映射到任意资源对象的 IDictionary。

public class ResourceDictionary : 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>>, Xamarin.Forms.Internals.IResourceDictionary
type ResourceDictionary = class
    interface IResourceDictionary
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
继承
System.Object
ResourceDictionary
实现
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>> System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IDictionary<System.String,System.Object> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IEnumerable<T> System.Collections.IEnumerable IResourceDictionary

构造函数

ResourceDictionary()

创建一个新的空 ResourceDictionary 对象。

属性

Count

ResourceDictionary 中的条目数。

Item[String]

检索与键 index 关联的 System.Object 值。

Keys

标识符 string 的集合,它们是 ResourceDictionary 中的键。

MergedDictionaries

获取合并到此字典中的字典集合。

MergedWith
已过时.

获取或设置合并资源字典的对象类型。

Source

获取或设置合并资源字典的 URI。

Values

检索 ResourceDictionary 的值。

方法

Add(ResourceDictionary)

mergedResourceDictionary 添加到 this 资源字典中的合并字典。

Add(String, Object)

keyvalue 作为键值对添加到 ResourceDictionary

Add(Style)

向 ResourceDictionary 添加隐式样式。

Add(StyleSheet)

styleSheet 添加到 this 资源字典的样式表列表。

Clear()

清空 ResourceDictionary

ContainsKey(String)

ResourceDictionary 是否包含由 key 标识的键值对。

GetEnumerator()

返回 ResourceDictionarySystem.Collections.Generic.KeyValuePair`2System.Collections.Generic.IEnumerator`1

Remove(String)

ResourceDictionary 中删除 key 标识的键和值。

SetAndLoadSource(Uri, String, Assembly, IXmlLineInfo)

供 Xamarin.Forms 平台内部使用。

TryGetValue(String, Object)

可将标识符字符串映射到任意资源对象的 IDictionary。

显式接口实现

ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>)

向集合中添加一项。

ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>)

返回一个值,该值指示字典是否包含 item 中的值,由 item 中的键索引。

ICollection<KeyValuePair<String,Object>>.CopyTo(KeyValuePair<String,Object>[], Int32)

供 Xamarin.Forms 平台内部使用。

ICollection<KeyValuePair<String,Object>>.IsReadOnly

获取指示资源字典是否为只读的值。

ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>)

供 Xamarin.Forms 平台内部使用。

IEnumerable.GetEnumerator()

供 Xamarin.Forms 平台内部使用。

IResourceDictionary.ValuesChanged

可将标识符字符串映射到任意资源对象的 IDictionary。

扩展方法

ForEach<T>(IEnumerable<T>, Action<T>)

供 Xamarin.Forms 平台内部使用。

GroupToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

供 Xamarin.Forms 平台内部使用。

IndexOf<T>(IEnumerable<T>, T)

供 Xamarin.Forms 平台内部使用。

IndexOf<T>(IEnumerable<T>, Func<T,Boolean>)

供 Xamarin.Forms 平台内部使用。

Prepend<T>(IEnumerable<T>, T)

供 Xamarin.Forms 平台内部使用。

适用于