Share via


ResourceDictionary.Add 方法

定义

重载

Add(ResourceDictionary)

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

Add(Style)

向 ResourceDictionary 添加隐式样式。

Add(StyleSheet)

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

Add(String, Object)

keyvalue 作为键值对添加到 ResourceDictionary

Add(ResourceDictionary)

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

public:
 void Add(Microsoft::Maui::Controls::ResourceDictionary ^ mergedResourceDictionary);
public void Add (Microsoft.Maui.Controls.ResourceDictionary mergedResourceDictionary);
member this.Add : Microsoft.Maui.Controls.ResourceDictionary -> unit
Public Sub Add (mergedResourceDictionary As ResourceDictionary)

参数

mergedResourceDictionary
ResourceDictionary

要添加的资源字典。

适用于

Add(Style)

向 ResourceDictionary 添加隐式样式。

public:
 void Add(Microsoft::Maui::Controls::Style ^ style);
public void Add (Microsoft.Maui.Controls.Style style);
member this.Add : Microsoft.Maui.Controls.Style -> unit
Public Sub Add (style As Style)

参数

style
Style

要添加的隐式样式。

注解

隐式样式将应用于此 ResourceDictionary 所有者的后代中与 TargetType 匹配的所有 VisualElement,除非向元素显式应用 Style。

隐式样式通过不指定元素的 x:Key 添加到 XAML 中的 ResourceDictionary。

适用于

Add(StyleSheet)

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

public:
 void Add(Microsoft::Maui::Controls::StyleSheets::StyleSheet ^ styleSheet);
public void Add (Microsoft.Maui.Controls.StyleSheets.StyleSheet styleSheet);
member this.Add : Microsoft.Maui.Controls.StyleSheets.StyleSheet -> unit
Public Sub Add (styleSheet As StyleSheet)

参数

styleSheet
StyleSheet

要添加的样式表

适用于

Add(String, Object)

keyvalue 作为键值对添加到 ResourceDictionary

public:
 virtual void Add(System::String ^ key, System::Object ^ value);
public void Add (string key, object value);
abstract member Add : string * obj -> unit
override this.Add : string * obj -> unit
Public Sub Add (key As String, value As Object)

参数

key
String

用于检索 value 的标识符。

value
Object

Object 关联的 key

实现

适用于