-
Notifications
You must be signed in to change notification settings - Fork 17
use RelayCommandAttribute in uno templates when using the MVVM pattern #1298
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
base: main
Are you sure you want to change the base?
Conversation
|
@corvinsz did you also get the observable Properties working? I just could decide between compiler telling me I would try to use reflection and should use aot compartble definition or it wanted me to use the .net 9 fields... Like I tryed every community Toolkit described scenario for them and nothing was not giving me a warning. |
|
@DevTKSS I assume you mean using the new partial properties which got released with .NET 9? I have not tried that, no.
I changed the command-bindings from Does this answer your question? |
|
Oh that's interesting! Did not recognize this detail so far on the command and relay commands... |
|
@DevTKSS I'm not super familiar with uno itself, but I just spun up a uno project and was able to successfully data-bind a partial property. In order for this to work you have to set the |
| public ICommand Logout { get; } | ||
|
|
||
| #endif | ||
| [RelayCommand] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't remove the Authentication and mauiembedding scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corvinsz could you check on this? Would be cool if this enhancement you trying to add could get added also from my user POV :)
GitHub Issue (If applicable): -
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently the ICommand properties are not source generated.
What is the new behavior?
The ICommand properties are being source generated.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
I recently created an uno project using the templates you guys provide via https://new.platform.uno/.
I noticed when selecting the
MVVMpattern, it does not utilize the RelayCommandAttribute from the CommunityToolkit.Mvvm.Unless there are uno specific limitations or guidelines I'm not aware of, I don't see a reason to not use the source generated property.
I'm new to uno, so bear with me if what I'm proposing is total nonsense.