Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Specifies null
as a value for a XAML member.
<object property="{x:Null}" .../>
The keyword for a null reference in C# and C++ is null. The Microsoft Visual Basic keyword for a null reference is Nothing
, but you always use {x:Null}
as the XAML usage regardless which code-behind language you associate with the XAML.
The x:Null
markup extension has no settable properties.
A null usage is often associated with the XAML member exposure of a CLR Nullable<T> value.
The x:Null
markup extension, like all XAML markup extensions, uses the braces ({,}
) for escaping the handling of attribute values to be other than literals or event-handler references. Attribute syntax is the syntax most frequently used with this markup extension. An object element syntax <x:Null />
is technically possible, but is rarely used because the x:Null
markup extension has no positional parameters or construction arguments.
For information about markup extensions, see Markup Extensions and WPF XAML.
In .NET XAML Services, the handling for this markup extension is defined by the NullExtension class.
Note that null
is not necessarily the initial unset value for a reference-type dependency property. The initial default value can vary for each dependency property and can be based on property-specific metadata. Many dependency properties do not accept null
as a value, either through markup or code because of their validation callback implementations. For more information about dependency properties, see Dependency Properties Overview.
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now