/
XmlnsPrefixAttribute.xml
176 lines (169 loc) · 13.8 KB
/
XmlnsPrefixAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<Type Name="XmlnsPrefixAttribute" FullName="System.Windows.Markup.XmlnsPrefixAttribute">
<TypeSignature Language="C#" Value="public sealed class XmlnsPrefixAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit XmlnsPrefixAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.Windows.Markup.XmlnsPrefixAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class XmlnsPrefixAttribute
Inherits Attribute" />
<TypeSignature Language="F#" Value="type XmlnsPrefixAttribute = class
 inherit Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class XmlnsPrefixAttribute sealed : Attribute" />
<AssemblyInfo>
<AssemblyName>System.Xaml</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="WindowsBase" FromVersion="4.0.0.0" To="System.Xaml" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeForwarding From="WindowsBase" FromVersion="5.0.0.0" To="System.Xaml" ToVersion="5.0.0.0" FrameworkAlternate="windowsdesktop-5.0" />
<TypeForwarding From="WindowsBase" FromVersion="6.0.0.0" To="System.Xaml" ToVersion="6.0.0.0" FrameworkAlternate="windowsdesktop-6.0" />
<TypeForwarding From="WindowsBase" FromVersion="7.0.0.0" To="System.Xaml" ToVersion="7.0.0.0" FrameworkAlternate="windowsdesktop-7.0" />
<TypeForwarding From="WindowsBase" FromVersion="8.0.0.0" To="System.Xaml" ToVersion="8.0.0.0" FrameworkAlternate="windowsdesktop-8.0" />
<TypeForwarding From="WindowsBase" FromVersion="9.0.0.0" To="System.Xaml" ToVersion="9.0.0.0" FrameworkAlternate="windowsdesktop-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Runtime.CompilerServices.TypeForwardedFrom("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.TypeForwardedFrom("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Identifies a recommended prefix to associate with a XAML namespace for XAML usage, when writing elements and attributes in a XAML file (serialization) or when interacting with a design environment that has XAML editing features.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
XAML processors or frameworks that incorporate XAML, or any process that performs XAML serialization, should generally honor the recommended prefix. The prefix might be necessary in any case where prefixes from specific mappings in the original XAML source are not somehow preserved in the runtime object graph or otherwise stored by a framework or technology. A framework might have specific preferences for how to serialize its own types that ignore the recommended prefix from its own assemblies; this might be done to consistently promote a default XAML namespace. However, such a framework should still provide recommended prefixes for possible third-party and tool usages of its XAML types. See "Best Practice for XAML Designer Support or General Serialization" section below.
A general recommendation for prefixes is to use short strings, because the prefix is typically applied to all serialized elements that come from the XAML namespace. The prefix string length can have a noticeable effect on the size of serialized XAML output.
If a prefix being requested is already in use by another previously encountered/serialized XAML namespace identifier, the behavior is unspecified (behavior is up to each individual XAML processor implementation).
In most cases, you apply <xref:System.Windows.Markup.XmlnsPrefixAttribute> only if you have also applied at least one <xref:System.Windows.Markup.XmlnsDefinitionAttribute> in the assembly for that same XAML namespace.
In previous versions of the .NET Framework, this class existed in the WPF-specific assembly WindowsBase. In .NET Framework 4, <xref:System.Windows.Markup.XmlnsPrefixAttribute> is in the System.Xaml assembly. For more information, see [Types Migrated from WPF to System.Xaml](/dotnet/framework/xaml-services/types-migrated-from-wpf-to-system-xaml).
## Best Practice for XAML Designer Support or General Serialization
Even if you intend the associated XAML namespace to be the default XAML namespace in most usage cases for your framework or library, you should still specify a non-empty string as the recommended prefix for a XAML namespace. Default XAML namespace information is carried in individual XAML files and XAML node streams. The default XAML namespace and how it is defined in a given XAML source can easily be perpetuated for per-case serialization without using <xref:System.Windows.Markup.XmlnsPrefixAttribute>. However, the <xref:System.Windows.Markup.XmlnsPrefixAttribute> is useful for cases where the XAML author has chosen to map the default XAML namespace to something else. In this scenario a XAML text editor embedded in a design environment can use <xref:System.Windows.Markup.XmlnsPrefixAttribute> as a hint for an initial XAML namespace `xmlns` mapping. Or a design environment can add just-in-time mappings to the backing XAML for design metaphors such as dragging objects out of a toolbox and into a visual design surface. Also, it is conceivable that a designer could simultaneously support multiple XAML-enabling frameworks, and has a common XAML serializer that relies on .NET Framework XAML Services rather than framework-specific serialization. Specifying a <xref:System.Windows.Markup.XmlnsPrefixAttribute> for these scenarios helps make the XAML usage for your types more portable and robust if the XAML is exchanged between design tools, or undergoes a round trip between XAML editors and other consumers such as markup compilers or other serialization.
]]></format>
</remarks>
<related type="Article" href="/dotnet/desktop-wpf/xaml-services/clr-attributes-with-custom-types-and-libraries">XAML-related CLR attributes for custom types and libraries</related>
<related type="Article" href="/dotnet/desktop-wpf/xaml-services/define-custom-types">Define custom types for use with .NET XAML Services</related>
<related type="Article" href="/dotnet/desktop-wpf/xaml-services/">XAML Services</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlnsPrefixAttribute (string xmlNamespace, string prefix);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string xmlNamespace, string prefix) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Markup.XmlnsPrefixAttribute.#ctor(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (xmlNamespace As String, prefix As String)" />
<MemberSignature Language="F#" Value="new System.Windows.Markup.XmlnsPrefixAttribute : string * string -> System.Windows.Markup.XmlnsPrefixAttribute" Usage="new System.Windows.Markup.XmlnsPrefixAttribute (xmlNamespace, prefix)" />
<MemberSignature Language="C++ CLI" Value="public:
 XmlnsPrefixAttribute(System::String ^ xmlNamespace, System::String ^ prefix);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xaml</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="xmlNamespace" Type="System.String" />
<Parameter Name="prefix" Type="System.String" />
</Parameters>
<Docs>
<param name="xmlNamespace">The XAML namespace identifier.</param>
<param name="prefix">The recommended prefix string.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Markup.XmlnsPrefixAttribute" /> class.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="xmlNamespace" /> or <paramref name="prefix" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Prefix">
<MemberSignature Language="C#" Value="public string Prefix { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Prefix" />
<MemberSignature Language="DocId" Value="P:System.Windows.Markup.XmlnsPrefixAttribute.Prefix" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Prefix As String" />
<MemberSignature Language="F#" Value="member this.Prefix : string" Usage="System.Windows.Markup.XmlnsPrefixAttribute.Prefix" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ Prefix { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xaml</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the recommended prefix associated with this attribute.</summary>
<value>The recommended prefix string.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="XmlNamespace">
<MemberSignature Language="C#" Value="public string XmlNamespace { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string XmlNamespace" />
<MemberSignature Language="DocId" Value="P:System.Windows.Markup.XmlnsPrefixAttribute.XmlNamespace" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property XmlNamespace As String" />
<MemberSignature Language="F#" Value="member this.XmlNamespace : string" Usage="System.Windows.Markup.XmlnsPrefixAttribute.XmlNamespace" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ XmlNamespace { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xaml</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the XAML namespace identifier associated with this attribute.</summary>
<value>The XAML namespace identifier.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>