Why Silverlight Tab item's Height and width not accessible at runtime?

134 Views Asked by At

I have one Tab Control in silverlight. In my tab there are 2 tab item. In tab-1 and tab-2, i am adding run time control into Canvas. And i have one Save button out side of tab. My Xaml page like,

  <UniControls:UniTabControl Background="Transparent" ReorderTabRows="False"                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  
                                        Margin="0,0,5,0" BorderThickness="1" >
      <UniControls:UniTabItem Header="Form-1" TabIndex="0" Width="130" MinHeight="22"  VerticalAlignment="Center" HorizontalContentAlignment="Center" BorderThickness="0" Margin="0" IsSelected="True">
          <Canvas/>
      </UniControls:UniTabItem>
      <UniControls:UniTabItem Header="Form-1" TabIndex="0" Width="130" MinHeight="22"  VerticalAlignment="Center" HorizontalContentAlignment="Center" BorderThickness="0" Margin="0" IsSelected="True">
          <Canvas/>
      </UniControls:UniTabItem>
  </UniControls:UniTabControl>      

When i press save button and my tab-2 is active that time i got all the control from canvas but all control's actual-height/height and actual-width/width is 0. If my tab-1 is active that time i got value from actual-height/height and actual-width/width.

Please help me.

1

There are 1 best solutions below

0
On BEST ANSWER

The default behavior of the RadTabControl is to keep only the content of its SelectedTab in the VisualTree. However if you want to keep the content of the RadTabItem which you have already selected you can set the IsContentPreserved property of the RadTabControl.

Thanks