Repository navigation
[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! |
|
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 🙌 |
|
I believe it would be easy to implement and VERY VERY useful |
|
UNO Platform already has something implemented: |
|
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. |
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 |
|
FYI in https://github.com/HavenDV/DependencyPropertyGenerator they have implemented this as an attribute on the class. |
Uh oh!
There was an error while loading. Please reload this page.
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
All reactions