
MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide
By :

The attached properties are a special kind of properties. They are defined on one control but actually affect another control. While this might sound a bit confusing, the truth is we have actually used attached properties all along without knowing what they really are. The attached properties can be recognized quite easily as they have a constant syntax of PropertyTypeName.AttachedPropertyName
. Think about the Grid.Row
property for example, or Grid.Column
. In these cases, Grid
is the type and the property we are setting for it is either Row
or Column
. The element, which we define this property on, TextBox
, or any other UI Element, doesn't have a Grid.Row
property. In fact, it doesn't even know if it's placed inside Grid, Canvas, StackPanel
, or any other layout control. Instead, the Grid.Row
property tells the parent Grid
element in which row to place the calling object. If we take TextBox
, which resides inside Grid
, and set its Grid.Row
property to 3...
Change the font size
Change margin width
Change background colour