語言

Style.Resources 屬性

定義

取得或設定可在此風格範圍內使用的資源集合。

public:
 property System::Windows::ResourceDictionary ^ Resources { System::Windows::ResourceDictionary ^ get(); void set(System::Windows::ResourceDictionary ^ value); };
public System.Windows.ResourceDictionary Resources { get; set; }
[System.Windows.Markup.Ambient]
public System.Windows.ResourceDictionary Resources { get; set; }
member this.Resources : System.Windows.ResourceDictionary with get, set
[<System.Windows.Markup.Ambient>]
member this.Resources : System.Windows.ResourceDictionary with get, set
Public Property Resources As ResourceDictionary

屬性值

在這種風格範圍內可以使用的資源。

屬性

備註

XAML 屬性元素使用方式

<object>
  <object.Resources>
    oneOrMoreResourceElements
  </object.Resources>
</object>

-或-

<object>
  <object.Resources>
    <ResourceDictionary Source="externalDictionarySource"/>
  </object.Resources>
</object>

XAML 值

oneOrMoreResourceElements 一個或多個資源元素。 若要在 XAML 中的 StaticResource Markup Extension 或 DynamicResource Markup Extension 語法中被引用,資源元素必須具有 x:Key 屬性。

<ResourceDictionary Source=“ externalDictionarySource”/> 一個外部字典來源。 詳情請參見 合併資源字典。

適用於