语言

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]

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

Keys

标识符的集合,这些标识符string是键。ResourceDictionary

MergedDictionaries

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

MergedWith
已过时.

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

Source

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

Values

检索 . 的值 ResourceDictionary。

方法

名称 说明
Add(ResourceDictionary)

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

Add(String, Object)

添加 key 和 value 作为 ResourceDictionary 键值对。

Add(Style)

将隐式样式添加到 ResourceDictionary。

Add(StyleSheet)

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

Clear()

清空 。ResourceDictionary

ContainsKey(String)

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

GetEnumerator()

返回一个 System.Collections.Generic.IEnumerator`1ResourceDictionary's System.Collections.Generic.KeyValuePair`2。

Remove(String)

从 .. 中删除由 标识的 键和值。

SetAndLoadSource(Uri, String, Assembly, IXmlLineInfo)

供Xamarin内部使用。窗体平台。

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内部使用。窗体平台。

ICollection<KeyValuePair<String,Object>>.IsReadOnly

获取一个值,该值指示资源字典是否为只读。

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

供Xamarin内部使用。窗体平台。

IEnumerable.GetEnumerator()

供Xamarin内部使用。窗体平台。

IResourceDictionary.ValuesChanged

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

扩展方法

名称 说明
ForEach<T>(IEnumerable<T>, Action<T>)

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

适用于