Style.Resources 属性

定义

获取或设置可在此样式的范围内使用的资源的集合。Gets or sets the collection of resources that can be used within the scope of this style.

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

属性值

ResourceDictionary

可在此样式的范围内使用的资源。The resources that can be used within the scope of this style.

属性

注解

XAML 属性元素用法XAML Property Element Usage

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

- 或 --or-

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

XAML 值XAML Values

oneOrMoreResourceElementsoneOrMoreResourceElements
一个或多个资源元素。One or more resource elements. 若要在中的 StaticResource 标记扩展DynamicResource 标记扩展 语法中稍后引用 XAMLXAML ,资源元素必须具有 x:Key 特性。To be referenced later in either StaticResource Markup Extension or DynamicResource Markup Extension syntax in XAMLXAML, a resource element must have an x:Key attribute.

<ResourceDictionary Source=" externalDictionarySource"/>
外部字典源。An external dictionary source. 有关详细信息,请参阅 合并资源字典For details, see Merged Resource Dictionaries.

适用于