How to bind value to its parent element value?

Posted by KentZhou on Stack Overflow See other posts from Stack Overflow or by KentZhou
Published on 2009-12-08T18:38:38Z Indexed on 2010/12/26 4:54 UTC
Read the original article Hit count: 199

Filed under:

Silverlight provides element to element binding. How to apply it this is case:

I have a xaml as below:

<TextBlock Text="{Binding ABC}" >
  <ToolTipService.ToolTip>
    <local:MyControl Title="{Binding ...}" />
  </ToolTipService.ToolTip>
</TextBlock>

I want to bind MyControl Title to the same data as its parent Textblock Text, but I don't want set x:Name for its parent Textblock.

I know there is one solution to bind Title to same data source:

<local:MyControl Title="{Binding ABC}" />

This may cause two times to call "{Binding ABC}", with my case, there ValurConverter for this binding. I don't want to use this way.

© Stack Overflow or respective owner

Related posts about silverlight-3.0