WPF binding Ancestor
Posted
by JerryVienna
on Stack Overflow
See other posts from Stack Overflow
or by JerryVienna
Published on 2010-04-20T11:58:21Z
Indexed on
2010/04/20
12:03 UTC
Read the original article
Hit count: 991
Hi Experts,
I have problems with bindings. I want to use a UserControl (Intellibox from codeplex) but I only get error messages in the output window.
Basically I have
window grid ... stuff ... usercontrol (self written) ... stuff ... usercontrol (IntelliBox)
In the Output window I get following stuff: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.UserControl', AncestorLevel='1''. BindingExpression:Path=ShowResults; DataItem=null; target element is 'Popup' (Name='IntelliboxPopup1'); target property is 'IsOpen' (type 'Boolean')
The binding in the IntelliBox control is defined as follows: {Binding Path=ShowResults, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}
I guess there is a problem, cause the nesting withing usercontrols - how to I get this error fixed?
Thanks!
© Stack Overflow or respective owner