how to bind width of child element to width of parent element in silverlight

ch.smrutiranjan parida picture ch.smrutiranjan parida · Sep 18, 2013 · Viewed 93.2k times · Source

I have a grid whose width is "1*". So the actual width decided at runtime I think. Within that grid I have another grid whose width I want to set to the runtime width of parent grid. How Can I do that in xaml through binding.

Answer

Anobik picture Anobik · Sep 26, 2013

This will actually help you I guess

Width="{Binding ActualWidth, ElementName=parentElementName}"

This binds the width to the parent element or the element name provided