Interviews1 answer
What is attached property? Which design pattern it implements?
Posted Oct 13, 2016, 6:37 PM EDT.NET
1 Answer
Attached properties are a special kind of Dependency Properties. They allow us to attach a value to an object that does not know anything about this value. It is like a global property.
Example:
If we place a text box inside a grid, we choose the grid cell where it’s positioned or in DockPanel we attach the one property with like Textbox like DockPanel.Dock.
It implements Flyweight Design pattern Global property is being shared with other objects.
Posted Oct 13, 2016, 6:37 PM EDT