ערוך

שתף באמצעות


StaticExtension Class

Definition

Implements a markup extension that returns static field and property references.

public ref class StaticExtension : System::Windows::Markup::MarkupExtension
[System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.StaticExtensionConverter))]
[System.Windows.Markup.MarkupExtensionReturnType(typeof(System.Object))]
public class StaticExtension : System.Windows.Markup.MarkupExtension
[System.Windows.Markup.MarkupExtensionReturnType(typeof(System.Object))]
public class StaticExtension : System.Windows.Markup.MarkupExtension
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.StaticExtensionConverter))>]
[<System.Windows.Markup.MarkupExtensionReturnType(typeof(System.Object))>]
type StaticExtension = class
    inherit MarkupExtension
[<System.Windows.Markup.MarkupExtensionReturnType(typeof(System.Object))>]
type StaticExtension = class
    inherit MarkupExtension
Public Class StaticExtension
Inherits MarkupExtension
Inheritance
StaticExtension
Attributes

Remarks

This class is a markup extension implementation for {x:Static} in the .NET XAML services support of XAML language features. For XAML usage information, see x:Static Markup Extension.

You typically use static references to obtain static values from types, including from types that cannot be instantiated in XAML because the type is static. Common examples of cases where {x:Static} is useful include values that can be thought of as constants, such as fixed math values or unique keys for states. The static members being referenced do not have to come from specific framework assemblies associated with XAML schema context. You can map other assemblies and CLR namespaces for XAML usage and then can refer to static members of types in XAML using the prefix you mapped.

Constructors

StaticExtension()

Initializes a new instance of the StaticExtension class.

StaticExtension(String)

Initializes a new instance of the StaticExtension class using the provided member string.

Properties

Member

Gets or sets a member name string that is used to resolve a static field or property based on the service-provided type resolver.

MemberType

Gets or sets the Type that defines the static member to return.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ProvideValue(IServiceProvider)

Returns an object value to set on the property where you apply this extension. For StaticExtension, the return value is the static value that is evaluated for the requested static member.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also