Show / Hide Table of Contents

Class StaticResourceExtension

Implements a markup extension that supports static (XAML load time) resource references made from XAML.

Inheritance
System.Object
MarkupExtension
StaticResourceExtension
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 Source

StaticResourceExtension()

Initializes a new instance of the StaticResourceExtension class.

Declaration
public StaticResourceExtension()
| Improve this Doc View Source

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 Source

ResourceKey

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 Source

ProvideValue(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.

Overrides
MarkupExtension.ProvideValue(IServiceProvider)

Implements

IMarkupExtension<T>
  • Improve this Doc
  • View Source