Replies: 4 comments
-
At least using Rider you can use a Live Snippet to quickly add styled properties. I think a source generator doesn't help here because the Register method has quite a few optional arguments with actions and stuff. |
Beta Was this translation helpful? Give feedback.
-
it's normal, and WPF does the same thing (WPF docs here). It's also just as annoying as it is there. There was someone who wrote a source generator to do it for you, but from memory there was some issue that made it not workable for some scenarios. I however can't recall what it was though. |
Beta Was this translation helpful? Give feedback.
-
Once partial properties are possible, sure. |
Beta Was this translation helpful? Give feedback.
-
There's https://github.com/jp2masa/Avalonia.PropertyGenerator as a sourcegen to experiment with. Haven't used it myself. Code snippets are good enough and I tuck away dependency properties in a MyControl.props.cs partial class file. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm pretty new to Avalonia and when creating controls, I feel constantly repeating the following snippet
Is this normal, or am I missing something?
I'm saying this because it seems like the perfect candidate for the source code generator, but I still struggle finding how to do things in Avalonia, so it may already be there.
Consider it a suggestion if it's not there :)
Beta Was this translation helpful? Give feedback.
All reactions