You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IL weaving-based generators don't work with statically checked stuff like {TemplateBinding}, and often don't support read-only or non-auto properties.
What about a PropertyInfo.SetterCalled event that obsoletes dependency properties for the most common use cases?
publicclassFancyButton:Button{// The property system uses `PropertyInfo.*` to find out everything that it wants to know, and `PropertyInfo.SetterCalled` to get notified of potential value changes.publicCornerRadius{get;set;}}
11 lines turned into 1.
As far as I can tell, the only things that this event wouldn't support are:
Coercion and validation.
Attached properties.
In these cases, you'd just define a dependency property as usual.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Dependency properties require a lot of boilerplate, and they're not generic:
IL weaving-based generators don't work with statically checked stuff like
{TemplateBinding}
, and often don't support read-only or non-auto properties.What about a
PropertyInfo.SetterCalled
event that obsoletes dependency properties for the most common use cases?11 lines turned into 1.
As far as I can tell, the only things that this event wouldn't support are:
In these cases, you'd just define a dependency property as usual.
Beta Was this translation helpful? Give feedback.
All reactions