I have a border which is defined in my xaml. I need to programmatically set another controls dimensions to the same as the border defined in my xaml.
I can't seem to get the dimensions as the Height & width are set to auto and Horizontal Alignment & Vertical Alignment are set to stretch.
<Border BorderBrush="Silver" BorderThickness="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="borderPlaceHolderIframe" />
I have tried
borderPlaceHolderIframe.Width //(Result= -1.#IND)
borderPlaceHolderIframe.ActualWidth //(Result= 0.0)
borderPlaceHolderIframe.DesiredSize //(Result= 0.0)
borderPlaceHolderIframe.RenderSize //(Result= 0.0)
I also tried getting the dimensions of the layoutRoot grid which the border is placed in, however the height & width of this are also Auto.
Is there any way of me getting the dimensions of this control without defining a fixed height & width?