Why redonly
sorry for my noobi question why in your examples structs are readonly?
I might be able to answer this, although this is my own interpretation of programming morality in this corner of the internet. The readonly keyword makes the structs immutable: they can be created, but not modified after creation. Immutability should be preferred over mutability whereever acceptable, because it makes for code that is safer to work with and less likely to cause issues whenever multi-threading is involved.
Checkout the following article for more info on immutability in C#. https://www.codeguru.com/csharp/c-sharp-immutability/
ICommand is like a message sent from one place to another.
This type of data is not in a state where someone keeps it for the long term.
That's why I made it readonly.
In programming in general, it is difficult to manage mutable state updates. Immutable data propagation is more predictable and testable. So I think it is cleaner to do so for data that can be marked as readonly, such as values. ( In recent years, there has been a trend in general-purpose programming languages such as C# and in the world of UI programming to adopt this approach to functional programming.
I hope this is helpful.