[Feature] Source generator for DependencyProperty boilerplate #593
Replies: 8 comments 2 replies
-
Thanks for submitting a new feature request! I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future! |
Beta Was this translation helpful? Give feedback.
-
Hello danielchalmers, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
Beta Was this translation helpful? Give feedback.
-
I believe it would be easy to implement and VERY VERY useful |
Beta Was this translation helpful? Give feedback.
-
UNO Platform already has something implemented: |
Beta Was this translation helpful? Give feedback.
-
DependencyProperty requires rather ugly boilerplates, if not the ugliest, and it would be really nice to see it's supported. Anyway, I'm fully behind this feature and I hope the code generator's functionalities are expanded gradually. It seems to slow down these days and I hope I'm wrong. |
Beta Was this translation helpful? Give feedback.
-
The problem is this syntax doesn't exist yet in C#. That's the Once that's done it'd be something to look at more closely, along with when null conditional-assignment becomes a thing, to help really clean-up our codebase around controls and properties. For now, we don't have plans to do something like this until partial properties become a thing, but it's something that's very much of interest to us in order to reduce a ton of boilerplate in the Toolkit. For now, I'd suggest checking out this project: https://github.com/HavenDV/DependencyPropertyGenerator |
Beta Was this translation helpful? Give feedback.
-
FYI in https://github.com/HavenDV/DependencyPropertyGenerator they have implemented this as an attribute on the class. |
Beta Was this translation helpful? Give feedback.
-
Closing as duplicate of #449 |
Beta Was this translation helpful? Give feedback.
-
Describe the problem this feature would solve
Like the new source generators in
Microsoft.Toolkit.Mvvm
, we could have an attribute that generates the boilerplate for aDependencyProperty
.You can replace:
with
With this, you could replace
with
which is a huge reduction in code!
Describe the solution
New feature that generates the boilerplate code for you.
Describe alternatives you've considered
Snippets, copy paste.
Additional context & Screenshots
Beta Was this translation helpful? Give feedback.
All reactions