I'm moderately new to MVVM, and I understand some of the advantages of MVVM over simple xaml code (e.g. VM testability). We use Caliburn Micro to do some bindings, but this kind of irrelevance, I could use a specific binding {binding ...}, and my question will more or less remain the same.
I understand the logic that a virtual machine does not need to know anything about V if everything is done correctly, but it seems that since we use dynamic binding of runtime between V and VM, the compiler cannot check the validity of each binding expression. For example, if I have a user interface component called UserName, then Caliburn will try to associate it with a VM property called UserName at runtime (similar to doing something like Value = "{binding UserName}"). However, if I rename my VM property or skip the name of the user interface component or the binding expression, we do not get any signs of a problem until runtime.
It seems to me that it would be very nice to tell xaml that the component or page of the user interface will be bound to a specific interface, so that the compiler can do some work that would otherwise (and be redone) by the testing department (and this is what I often do).
Is there any way to tell xaml that we are binding to an interface or object type? Is there any tool that can connect to the xaml app to check for bindings?
source
share