You couldn't use an ancestor/relative source binding to find the parent UC, 
thus Avoiding having to give the UC a specific name?

Shane


Shane Morris  |  Automatic Studio  |  
[email protected]<mailto:[email protected]>  |  +61 438 
818 888

On 28/10/2011, at 5:35 PM, "Greg Keogh" <[email protected]<mailto:[email protected]>> 
wrote:

I generally declare my dependency property as normal, then bind to it from the 
UserControl itself. So let’s say you had a real DP called TitleText, I’d do 
something like:

<UserControl ... x:Name=”me”>
    <TextBlock Text=”{Binding TitleText,ElementName=me}” />

... so now the owner of the UserControl can set TitleText and it will be 
reflected by the child control.


Thanks Matt ... fabulous! I stared at this code for some time before I realised 
what was happening. I didn’t think of doing it this way around. You make a 
typical DP for TitleText then bind the child control to “its own control”. This 
works, but I have to x:Name the <UserControl> and bind use that name as the 
ElementName exactly as you say.

Cheers, Greg
_______________________________________________
ozwpf mailing list
[email protected]<mailto:[email protected]>
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to