Markup Extensions
A MarkupExtension
allows code-based customization of setter logic to a target property in a convenient, reusable
syntax within XAML. Curly braces are used to differentiate the usage from plain text.
Avalonia provides the following:
MarkupExtension | Assigns to Property |
---|---|
StaticResource | An existing keyed resource and does not update on changes |
DynamicResource | Deferred loading of a keyed resource that will update on changes |
Binding | Based on the default binding preference: Compiled or Reflection |
CompiledBinding | Based on a compiled binding |
ReflectionBinding | Based on a reflection binding |
TemplateBinding | Based on a simplified binding used only within a ControlTemplate |
OnPlatform | Conditionally when on the specified platform |
OnFormFactor | Conditionally when on the specified factor |