Templated Control databinding to custom properties
- by Dan Wray
Is there some trick that I'm missing here?
I've created a templated control, very simple. One single property on it, and I'd like to databind from the (viewmodel/datacontext of the) page in which it's hosted to a custom property on the control. The property will eventually be a vector type object, defining the position of the control, however in an attempt to get this to work I've tried reducing it to a basic string property.
Each time I'm faced with "Set property 'SimpleGame.Classes.Sprite.Property' threw an exception.".
I can't even catch the exception in a debug session, the set property code is not being executed.
Do I need to use a dependency / attached property or something? I wouldn't have thought so...