Check invalide DependencyName

May 14, 2010 at 11:13 PM

Thanks for the great the ViewModelBase! It is exactly what I want.

my suggestion: Check if the DependencyName is valid or not in debug mode.



May 19, 2010 at 7:05 PM
zunyite, Thanks for the suggestion. It is a good one. However, I am not sure how to handle dynamic properties. For instance, if I depend upon a dynamic property named "MyDynamicFoo" and it hasn't been set by anyone yet, what should I do in that case? Brian
May 19, 2010 at 9:20 PM

add a parameter to the attribute to
DependsUpon("propertyname", checkname=true)
and a attribute
always check name


May 20, 2010 at 1:47 PM
Great feedback. I will incorporate it when I get the chance. Right now, I am working on getting ViewModel creation via custom resolvers. In the mean time, if you want to submit a patch, I will be more than happy to incorporate it. Brian
Jun 5, 2010 at 3:52 AM


I have implemented this feature for you.  Here is how you use it:

[DependsUpon("InputA", VerifyStaticExistence = true)]

It will throw an ArgumentException if InputA does not exist.  I do it at DEBUG and RELEASE.  I don't like to have exceptions that only fire during DEBUG.
Hope it helps :)

Jun 5, 2010 at 5:00 PM