Need help binding a checkbox to an object property
Need some clarificaton on how to setup bindings appropriately
I declare the object I want to bind to in the resources of my Grid like this. Note: PreOpenSetting is the name of the object, which implements a public get/set pair for the bool it contains.
<
ObjectDataProviderx:Key="PreOpen"ObjectType="{x:Type src:PreOpenSetting}"/>I then bind the IsChecked property of my checkbox like this
<
CheckBoxIsChecked="{Binding Path=PreOpen}"At runtime however, the PreOpenSetting object isn't instantiate and thus the control doesn't reflect its value
If instead, I specify the object as a data source, like this.
<CheckBox.IsChecked>
<Binding Path="PreOpen" Source="{StaticResource PreOpen}" >
</Binding>
</CheckBox.IsChecked>
then the object is instantiated and the checkbox reflects the value properly.
Obviously I'm missing a conceptual piece of this puzzle. How do I siimply bind to the value rather than specifying it as a data source?

