J'ai deux dockpanels qui ont chacun un StackPanel gauche.Comment faire une largeur StackPanel celle d'un autre StackPanel?
La largeur du fond StackPanel est déterminée par la largeur du texte est en elle.
La largeur de la partie supérieure StackPanel devrait être la même que la largeur du fond StackPanel.
J'ai essayé de lier la largeur de la partie supérieure StackPanel à la largeur du fond StackPanel par ElementName mais cela ne fonctionne pas.
Comment puis-je faire la largeur supérieure identique à la largeur de fond?
alt text http://i33.tinypic.com/59wj6s.jpg
<StackPanel>
<DockPanel LastChildFill="True" Height="100" >
<StackPanel Width="{Binding ElementName=LeftMenuText, Path=Width}"
DockPanel.Dock="Left"
Background="Yellow">
<TextBlock
Text="This is some text."/>
</StackPanel>
<StackPanel DockPanel.Dock="Right"
Background="Orange">
</StackPanel>
</DockPanel>
<DockPanel
Height="3"
Background="Black"></DockPanel>
<DockPanel LastChildFill="True" Height="100">
<StackPanel Name="LeftMenuWrapper"
DockPanel.Dock="Left"
Background="Yellow">
<TextBlock
Text="This is some text that is longer."/>
</StackPanel>
<StackPanel DockPanel.Dock="Right"
Background="Blue">
</StackPanel>
</DockPanel>
</StackPanel>