-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix markup extension for avalonia #11
Conversation
StefanKoell
commented
Jun 7, 2024
- rename markup extension class to SymbolIconExt to avoid conflicts for style selectors
- remove default values in the markup extension (nullable props) to allow style selectors set property values
- remove default values in SymbolIcon ctor to allow style selectors set property values
- little bit of code cleanup to make analyzers happy
* rename markup extension class to SymbolIconExt to avoid conflicts for style selectors * remove default values in the markup extension (nullable props) to allow style selectors set property values * remove default values in SymbolIcon ctor to allow style selectors set property values * little bit of code cleanup to make analyzers happy
No, this
Maybe make the property |
I did test this and for me it worked when I used the AppBuilderExtension to set the internal static |
Weird. I suppose that all static fields has to be initialized before it can be changed, so the property would have been created before |
I think it works because the AppBuilder extension is currently the only way to alter the default and this is executed before the whole Avalonia infrastructure is built. So at the time the styled properties are set, the static default value is already set. That's my guess at least. If it should be possible to alter the value afterwards, it has to be implemented differently but in that case, the ability to use style selectors to "override" the value will be gone. A bit off topic but this setting is a mystery to me. Is there any documentation what value this should be? Is it encouraged to set it to true? |
It enables a modified version of The most significant change is that Segoe uses a stroke width of 1/16 (of size of bounding square) while |
Thanks for the clarifications. This explains a couple of things. I have other icon sources as well and they are designed according to the fluent system guidelines (smaller appearance, padding around, etc.). So in this case I need to keep the Regarding the PR: |
I didn't see it in the changelog, but is there any issue caused by inheriting MarkupExtension?
I need more tests on this. |
I think the requirement to inherit from MarkupExtension is deprecated IIRC. The official docs show MarkupExtension as a standalone class: https://docs.avaloniaui.net/docs/concepts/markupextensions I also briefly looked at the Avalonia source code and most MarkupExtensions are not inheriting from MarkupExtension: |
…selectors happy. (#11) Co-authored-by: Stefan Koell <stefan.koell@royalapps.com>
…selectors happy. (#11) Co-authored-by: Stefan Koell <stefan.koell@royalapps.com>
Make style selectors happy. (#11) Co-authored-by: Stefan Koell <stefan.koell@royalapps.com>
Issues addressed. |
Make style selectors happy. Co-authored-by: Stefan Koell <stefan.koell@royalapps.com>