use RelayCommandAttribute in uno templates when using the MVVM pattern#1298
use RelayCommandAttribute in uno templates when using the MVVM pattern#1298corvinsz wants to merge 1 commit intounoplatform:mainfrom
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.
We can't remove the Authentication and mauiembedding scenarios
There was a problem hiding this comment.
@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.