wpf control width binding

Terco picture Terco · May 3, 2011 · Viewed 31.8k times · Source

I have two borders with content, The second border width changes depending on the content, I'm trying to bind the first border to the second border width but it's not working and I'm not sure what i'm missing. Can someone give me some direction please? Below is a example of what I'm currently trying.

<Border x:Name="border1" Width="{Binding Path=Width, ElementName=border2}">
    ... 
</Border>

<Border x:Name="border2">
    ...
</Border>

Answer

H.B. picture H.B. · May 3, 2011

Change the path to ActualWidth.