-
Notifications
You must be signed in to change notification settings - Fork 7
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
[C#] Add sugar for State properties #42
Comments
Hello! I just stumbled upon your project today. I started playing with SwiftUI and found myself thinking "gosh I wish I could write this in C#", and thought to take a peek as to what's out there. Was just poking through the issues to see how active your project was, and found this one in particular. I was thinking when looking at the readme that "I bet they wish it was just an attribute instead of having this whole state class to create", so it was fun to see that you definitely had the idea too. There's a solid chance you've already considered it, but in lieu of source generators, have you thought about implementing sugar like that as a Fody weaver? I'm not quite versed on the internals of how it does the IL rewriting, but, it seems like it'd be a very similar thing to how they this Lazy addin works, generating code based on the property adorned with the attribute. Anywho, cheers and keep up the great work! |
Hey, I'll try implementing weaver for this feature in a separate nuget this weekend! |
Glad you stumbled on us! The IL weaver is a decent idea. I think I was holding out to see what could be done with a source generator because it's much simpler to integrate with the build and tooling.
Awesome! Let me know if you have any questions |
https://github.com/MrGreger/SwiftUI.Postsharp I made the Nuget package, it works for .net standard 2.1 projects, but I can't check how it works in xamarin. ios / xamarin.mac projects @chkn could you check how it works for xamarin projects? |
Ideally, I'd like to achieve a syntax like this:
Under the covers it would be expanded to this:
Unfortunately, I don't think source generators are flexible enough for this currently.
The text was updated successfully, but these errors were encountered: