We have gone through an example on Dependency Property and unlike Dependency Property, attached property is meant for use in XAML.
One purpose of an attached property is to allow different child elements to specify unique values for a property that is actually defined in a parent element.
In XAML, they are always defined by using the syntax AttachedPropertyProvider.PropertyName
Consider the following example.
<DockPanel> <CheckBox DockPanel.Dock="Top">Hello</CheckBox> </DockPanel>
DockPanel.Dock is an attached property of DockPanel. With DockPanel.Dock, we can inform the DockPanel how we should postition the CheckBox.