mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-06 07:56:06 +02:00
39 lines
2.7 KiB
Markdown
39 lines
2.7 KiB
Markdown
---
|
||
title: "x:Member Directive"
|
||
ms.date: "03/30/2017"
|
||
ms.assetid: 4d8394ef-644c-4331-b6c5-be855d392980
|
||
---
|
||
# x:Member Directive
|
||
|
||
Declares a XAML member in markup.
|
||
|
||
## XAML Object Element Usage
|
||
|
||
```xaml
|
||
<object x:Class="className">
|
||
<x:Members>
|
||
<x:Member Name="propertyName"/>
|
||
additionalMembers
|
||
</x:Members>
|
||
</object>
|
||
```
|
||
|
||
## XAML Values
|
||
|
||
|||
|
||
|-|-|
|
||
|`className`|Name of the backing class or partial class for the XAML production.|
|
||
|`memberName`|Member name of the property being defined.|
|
||
|
||
## Remarks
|
||
|
||
In .NET XAML Services implementation, . `x:Member` does not have a direct type backing, but is supported by the <xref:System.Windows.Markup.MemberDefinition> class. In a XAML node stream, an `x:Member` element is represented as a member named `Member`, from the XAML language XAML namespace. The member `Member` holds attributes as declared by markup.
|
||
|
||
The meaning of `Name` and `Type` are not assigned at .NET XAML Services level. They are stored in the initial XAML node stream as string values, to be interpreted later under the rules that might be imposed by specific frameworks. The meaning might align to a XAML name and XAML type meaning, or might only be valid in a backing type system, depending on the implementation.
|
||
|
||
To support a practical usage of `x:Members` as a means to specify member definitions in markup, the members must be associated with a class that can be modified. The intended model is that `x:Members` exists as a member of a type that specifies an `x:Class`. However, the mechanism for associating types and members or for producing dynamic member definitions is not supported at .NET XAML Services level. This is left to individual frameworks that have application models that support member definitions from XAML. Typically, MSBUILD build actions that markup-compile the XAML and either integrate it with code-behind or produce pure from-XAML assemblies are needed to support that feature.
|
||
|
||
## x:Property for Windows Workflow Foundation
|
||
|
||
For Windows Workflow Foundation, `x:Property` defines the members of a custom activity composed entirely in XAML, or XAML –defined dynamic members for an activity designer with code-behind. `x:Class` must also be specified on the root element of the XAML production. This is not a requirement at .NET XAML Services level, but becomes a requirement when the XAML production is loaded by the MSBUILD build actions that support custom activities and Windows Workflow Foundation XAML in general. Windows Workflow Foundation does not use the pure XAML type name as its intended value for the `x:Property` `Type` attribute, and instead uses a convention that is not documented here. For more information, see [DynamicActivity Creation](/previous-versions/dotnet/netframework-4.0/dd807392(v=vs.100)).
|