-
Notifications
You must be signed in to change notification settings - Fork 70
🧪 [Experiment] DependencyPropertyGenerator #621
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
Comments
Why was the name of the attribute changed from DependencyPropertyAttribute to GeneratedDepedencyPropertyAttribute? |
@insomniachi see the comment here: #617 (comment)
|
@Arlodotexe should we re-open this for tracking or have another tracking issue? It got closed from the first PR merging. |
@michael-hawker Since this is a brand-new component and not a porting checklist, I think it makes sense to keep this ticket around for tracking the component. Sub-issues shouldn't close it in the future. |
Just wanted to link to open PR around getting better documentation here: #665 |
@Sergio0694 for attached properties, was this not our best hope for simplification? [GeneratedAttachedProperty]
public static partial int GetMyValue(DependencyObject obj); As we still have the property value type (int), the property name (after Get), and the target attachment type (parameter type). It's not the prettiest or simplest to remember, but this is the rarest of properties to use. The setter is just more verbose, and we can't really use the field masquerading as a property as we can't generate that, right? And for existing implementations, this'll still exist, so a fixer would just remove the body and mark it partial + attribute, and then have to remove the other bits. |
Uh oh!
There was an error while loading. Please reload this page.
Note
Originally from #449.
Overview
Tracking issue for the new
DependencyProperty
generator, for UWP (both .NET Native and .NET 9) and WinUI 3.This is what using the new generator looks like:
It only supports instance properties. Attached properties are not currently supported.
Remaining task
Here's a few remaining tasks to track work:
DefaultValueCallback
PropertyMetadata
constructionDefaultValue
andDefaultValueCallback
at the same timeDefaultValueCallback
set tonull
DefaultValueCallback
not matching an existing methodDefaultValueCallback
matching an invalid method (eg. wrong signature)default(T)
for default values on unconstrained generic type parameters[NotNull]
on property gettersThe text was updated successfully, but these errors were encountered: