This XAML source:
<TextBlock Margin="10,0,0,0" FontSize="16" />
is compiled to BAML, according to ILSpy:
<TextBlock Margin="10,0,0,0" TextBlock.FontSize="16" />
I may be wrong but it seems the BAML version uses the attached property syntax instead of the property syntax (used for example for Margin
).
I found:
- This related question How is the attached property TextBlock.FontSize used? says:
TextBlock.FontSize
is not an attached property, it's just a regular dependency property
which may be somehow contradictory with MSDN:
This dependency property also has an attached property usage. In XAML, the usage is <object TextBlock.FontSize="value".../>, where object is an object element (typically a flow element) contained within a TextBlock [...]
What is the correct explanation for this syntax difference between Margin
and FontSize
assignments in BAML?