Properties configure the appearance and behavior of controls.
For example:
<Button
Content="Login"
Width="120"
Height="40"
Background="RoyalBlue"
Foreground="White"/>
Here:
| Property | Purpose |
|---|---|
| Content | Text displayed on the button |
| Width | Width of the button |
| Height | Height of the button |
| Background | Background color |
| Foreground | Text color |
Property Syntax #
Properties are written as attributes.
<TextBlock
Text="Welcome"
FontSize="24"
FontWeight="Bold"/>
Attached Properties #
Some properties belong to parent controls rather than the child control itself.
Example:
<Grid>
<Button
Grid.Row="1"
Grid.Column="2"
Content="Save"/>
</Grid>
Grid.Row and Grid.Column are attached properties supplied by the Grid layout.
