BindableProperty non-static method name enhancement #3001
Replies: 2 comments
-
|
Hey Stephen! I plan on creating an Analyzer that will generate a compiler error if a developer supplies a method name that is using an invalid method signature. This analyzer will ensure that developers always use the correct return type and parameter types, and it'll also ensure the method is The Analyzer should cover scenarios where a developer forgets to supply a |
Beta Was this translation helpful? Give feedback.
-
|
Hi Brandon - thanks for the rapid response! An Analyzer would definitely be useful for catching mistakes with the current static method setup. What I'm suggesting, though, is a shift away from requiring static methods altogether. In my proposed generator changes, a static wrapper would handle casting the bindable object to the right type, so developers can just write normal instance methods and let the generator take care of the rest. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Instead of asking developers to write static methods for source generators, we could make things easier by letting them use regular instance methods. The benefit is that the methods are simpler, requiring no BindableProperty parameter or manual casting to the class type, since the source generator handles this automatically.
For example:
Would generate a wrapper that includes the BindableObject bindable property:
Tentative PR
Beta Was this translation helpful? Give feedback.
All reactions