2010-03-13 44 views
2

爲什麼這個工程僅WPF XAML裏面

<myToolTip:UserControl1> 
    <TextBlock Text="{Binding Path=TestString, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type myToolTip:UserControl1}}}"/> 
</myToolTip:UserControl1> 

結合但這並不

<myToolTip:UserControl1 x:Name="userControl"> 
    <TextBlock Text="{Binding Path=TestString, ElementName=userControl}"/> 
</myToolTip:UserControl1> 

,是真的沒有短(快)的方式,來訪問用戶控件元素?

回答

1

Here的解釋和解決方法。