I'm using a canvas to produce a hovering effect of my expander over elements below it and I bound its width to the expander's. However, I just noticed (when I changed the language) that one of the elements is a long string and it provides its width to the parent (the expander) when it's visible but not otherwise.
<Canvas Width="{Binding ActualWidth, ElementName=TheExpander}">
<Expander Name="TheExpander" ...>
<ListBox ... >
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox ... />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</Canvas>
Is there any relatively easy way to do that? If the correct solution requires me to rebuild the markup, I believe that I'll prefer to simply set the width of the canvas the ugly, nasty and slap-me-in-the-back-of-the-head way, i.e. hard-coded.