Hi,
VS has thrown a useless exception which I think is caused by the fact I have multiple DP's in two similar classes with the same name.
the classes are add/edit contact so they share a number of properties, my problem is this.
I can register a property as:
DependancyProperty.Register( /*...*/ );
or:
MyDP.AddOwner( /*...*/ )
problem being that I have no way of knowing whether the add or edit class will be instantiated first (depends on user choice), since they're defined as static, I can't put anything fancy in their initialisation logic... I'm out of ideas that can be self contained within the 2 classes.
So how do I set up the dependancy properties in this scenario?
Edit:
Type Initialization Exception: The type initializer for 'CharterHouseTouchScreenDemo.Views.Membership.AddMembershipView' threw an exception.
I know that it's one of the dependancy property initialisers because when stepping through it doesn't even get to the constructor.
also, in this case, they don't share enough similarities to be the same class. in a nutshell, the only thing they share is the information stored in this dependency property.
Edit 2
I'm suprised this isn't better documented, in any medium-large scale applications the chances of accidentally naming a dependancy property the same thing are pretty large. Especially for generic things like "BackgroundColour" or "HeadingText" "CurrentXYZ"...
I always assumed you passed the type of the owner class so that it wouldn't cause issues like this.