Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf control width binding

Tags:

width

binding

wpf

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> 
like image 356
Terco Avatar asked May 03 '11 17:05

Terco


1 Answers

Change the path to ActualWidth.

<Border x:Name="border1" Width="{Binding Path=ActualWidth, ElementName=border2}"> </Border> <Border x:Name="border2"> </Border> 
like image 111
H.B. Avatar answered Sep 28 '22 03:09

H.B.