Title sounds a bit abstract so I’ll try to illustrate:
I have this property in a nested ViewModel (InboundSVM):
It has the value 0 by default.
Now, in markup I try to increment it by staticCommand and I receive the expected C# warning typical for invalid init-only assignment:
I understand it’s a bit weird, but I think we should keep this behavior as is. We should make sure we don’t allow assigning to init only properties on the server (i.e. in a command binding), as that would allow you to mutate an instance you assumed is immutable. Changing the value client-side does not really allow you to change the .NET object, as it currently does not exist. During deserialization, a new object is initialized anyway.
Yes, the way of thinking regarding these init-only props is that they are init-only ooonly at the VM code level. Keeping in my mind that deserialization occurs and alien values from another universe come and populate properties from planet C# makes sense / helps.