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?

[2221 byte] By [NickNotYet] at [2007-12-23]
# 1
Is the DataContext specified somewhere in the CheckBox's ancester element hierarchy? It seems that it is not. Setting the Source of the Binding indicates where the value should come from, just for that CheckBox. Try setting the DataContext on the CheckBox, or something which contains it. Then the Binding's Path will know what object to inspect for the value.
JoshSmith at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

try this <CheckBox IsChecked="{Binding Source={StaticResource PreOpen}, Path=PreOpen}">

leed at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified