Share via


ResourceDictionary.Add 方法

定義

多載

Add(ResourceDictionary)

mergedResourceDictionary 新增至 this 資源字典中的合併字典。

Add(Style)

將隱含樣式新增至 ResourceDictionary。

Add(StyleSheet)

styleSheet 新增至 this 資源字典的樣式表清單。

Add(String, Object)

keyvalue 以索引鍵/值組新增至 ResourceDictionary

Add(ResourceDictionary)

mergedResourceDictionary 新增至 this 資源字典中的合併字典。

public void Add (Xamarin.Forms.ResourceDictionary mergedResourceDictionary);
member this.Add : Xamarin.Forms.ResourceDictionary -> unit

參數

mergedResourceDictionary
ResourceDictionary

要新增的資源字典。

適用於

Add(Style)

將隱含樣式新增至 ResourceDictionary。

public void Add (Xamarin.Forms.Style style);
member this.Add : Xamarin.Forms.Style -> unit

參數

style
Style

要新增的隱含樣式。

備註

除非明確套用 Style,否則隱含樣式會套用至此 ResourceDictionary 擁有者子系中符合 TargetType 的所有 VisualElements。

隱含樣式會在 XAML 中新增至 ResourceDictionary,方法是未指定元素的 x:Key。

適用於

Add(StyleSheet)

styleSheet 新增至 this 資源字典的樣式表清單。

public void Add (Xamarin.Forms.StyleSheets.StyleSheet styleSheet);
member this.Add : Xamarin.Forms.StyleSheets.StyleSheet -> unit

參數

styleSheet
StyleSheet

要新增的樣式表

適用於

Add(String, Object)

keyvalue 以索引鍵/值組新增至 ResourceDictionary

public void Add (string key, object value);
abstract member Add : string * obj -> unit
override this.Add : string * obj -> unit

參數

key
System.String

要用來擷取 value 的識別碼。

value
System.Object

System.Object 關聯的 key

實作

System.Collections.Generic.IDictionary`2.Add(`0,`1)

適用於