Add desktop-guide note to all WPF property articles (#1258)

This commit is contained in:
Tris Shores
2022-01-05 09:01:06 -08:00
committed by GitHub
parent 96056b1cdf
commit 58f6e05c13
9 changed files with 23 additions and 1 deletions
@@ -15,6 +15,8 @@ helpviewer_keywords:
This article describes how to register an attached property and provide public accessors that let you access the attached property through Extensible Application Markup Language (XAML) and code. Attached properties enable extra property/value pairs to be set on any XAML element, even though the element doesn't define those extra properties in its object model. The extra properties are globally accessible. Attached properties are typically defined as a specialized form of dependency property that doesn't have a conventional property wrapper. Most attached properties for Windows Presentation Foundation (WPF) types are also implemented as dependency properties. You can create dependency properties on any <xref:System.Windows.DependencyObject> derived type.
[!INCLUDE [desktop guide under construction](../../includes/desktop-guide-preview-note.md)]
## Example
The following example shows how to register an attached property as a dependency property, by using the <xref:System.Windows.DependencyProperty.RegisterAttached%2A> method. The provider class has the option of specifying a default value in property metadata. For more information on property metadata, see [Property metadata for a new dependency property](/dotnet/desktop/wpf/advanced/custom-dependency-properties?view=netframeworkdesktop-4.8&preserve-view=true#property-metadata-for-a-new-dependency-property). In this example, the `HasFish` property has a <xref:System.Boolean> value type, with its default value set to `false`.