Class StaticResourceExtension
Implements a markup extension that supports static (XAML load time) resource references made from XAML.
Implements
IMarkupExtension<System.Object>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Markup
Assembly: OpenSilver.dll
Syntax
public class StaticResourceExtension : MarkupExtension, IMarkupExtension<object>
Constructors
| Improve this Doc View SourceStaticResourceExtension()
Initializes a new instance of the StaticResourceExtension class.
Declaration
public StaticResourceExtension()
StaticResourceExtension(String)
Initializes a new instance of the StaticResourceExtension class, with the provided initial key.
Declaration
public StaticResourceExtension(string resourceKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceKey | The key of the resource that this markup extension references. |
Properties
| Improve this Doc View SourceResourceKey
Gets or sets the key value passed by this static resource reference. They key is used to return the object matching that key in resource dictionaries.
Declaration
public string ResourceKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceProvideValue(IServiceProvider)
Returns the object found in a resource dictionary, where the object to find is identified by the ResourceKey.
Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
System.IServiceProvider | serviceProvider | Object that can provide services for the markup extension. |
Returns
Type | Description |
---|---|
System.Object | The object value to set on the property where the markup extension provided value is evaluated. |