Replies: 1 comment 1 reply
-
@bwjunkie the MVVM Toolkit is a spiritual successor not a fork, it didn't start from the codebase of MVVMLight. While it was intended to be easy to migrate from MVVMLight, there was not a goal to maintain complete compatibility with the API/behavior of MVVMLight. I don't think there was ever an intent to support straight base types for messages. The main issue is Generally, you'd create a record (class) to encapsulate your message data (which also makes it more extensible for adding other values to your message later on): public record MyGuidMessage(Guid Id);
Messenger.Default.Send<MyGuidMessage>(new(_guid)); |
Beta Was this translation helpful? Give feedback.
-
mvvmLight allowed
Messenger.Register<Guid>(...
CommunityToolkit error:
Type argument 'Guid' does not satisfy the Class constraint for type parameter TMessage
Question: is this a breaking change from mvvmlight (which must have a different implementation of TMessage?)
note: the migration documentation : https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/migratingfrommvvmlight#migrating-observableobject
thank you
Josh
Beta Was this translation helpful? Give feedback.
All reactions