What are attached properties?

 Posted by Blessybaby on 1/4/2010 | Category: WPF Interview questions | Views: 4523

These are dependency properties that belong to one class but can be used in another.
Consider the below code snippet:-
<Rectangle Height="72" Width="131" Canvas.Left="74" Canvas.Top="77" />
4 7 9
Height and Width are regular properties of the Rectangle. But Canvas.Top and Canvas.
Left is dependency property as it belongs the canvas class. It’s used by the Rectangle to
specify its position within Canvas.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Webmaster on: 5/25/2013 | Points: 10
To know the difference between "Attached Property " and "Dependency Property ", visit http://blogs.msdn.com/b/helloworld/archive/2010/06/25/understanding-wpf-dependency-property-and-attached-property.aspx


Login to post response