WPF StaticResource bound to subproperty

Posted by mizipzor on Stack Overflow See other posts from Stack Overflow or by mizipzor
Published on 2010-05-30T19:49:20Z Indexed on 2010/05/30 19:52 UTC
Read the original article Hit count: 192

Filed under:

I have a class thats created as a resource:

<Window.Resources>
    <Model:MyModel x:Key="model" />
</Window.Resources>

The MyModel class has a cli property named Foo. I want the selected value in a combobox to be bound to this property. I thought I could do this but Im getting errors:

<ComboBox SelectedItem="{Binding Source={StaticResource model.Foo}}" />

Heres the error:

Cannot find resource named '{model.Foo}'.

Where did I go wrong? What extra parameters do I need to specify to properly bind to a subproperty?

© Stack Overflow or respective owner

Related posts about wpf