I've been having trouble with some databinding with WPF. I have a class to hold various data. I want the data it holds to be binded to Text Boxes in a different window. Everything I've found reccomends this:
<Grid.Resources>
<c:PropertyModel x:Key="propMod" />
</Grid.Resources>
<Grid.DataContext>
<Binding Source="{StaticResource propMod}"/>
</Grid.DataContext>
The problem with this is it's instantiated somewhere and I have no way to get to this 'propMod'. I'd like to change some of propMod's properties from code.
The other method I've tried is to create an instance in the code-behind, eg
PropertyModel propMod = new PropertyModel();
But I can't get WPF to bind to this, despite the documentation claiming that {Binding propMod.PropA} should work.
Thanks