👉 How To Troubleshoot Styles
Much of the Avalonia UI styling system corresponds to CSS styling approaches. So without knowledge of this technology, you may find the hints here helpful.
Selector has no Targets
An Avalonia UI selector, like a CSS selector, does not raise an error or warning when there are no controls which can be matched. The style will silently fail to show.
к сведению
Check whether you have used a name or class that does not exist.
к сведению
Check whether you have used a child selector where there are no children to match.
Include File Sequence
Styles are applied in order of declaration. If there are multiple style files included that target the same control property, the last style included will override the previous ones. For example:
<Style Selector="TextBlock.header">
<Style Property="Foreground" Value="Green" />
</Style>