Hi all. I have a Silverlight Usercontrol where I have a tabcontrol which uses a couple of tabitems. Now each tabitem is another Usercontrol. I was wondering if there is a way to access an object of one of these usercontrol tabitems.
For example if I have a xaml in my main usercontrol:
<controls:TabControl x:Name="TabControl" Grid.Row="1" Grid.Column="1" Foreground="#234BC3">
<controls:TabItem Header="Prestaties" x:Name="TabPres" Visibility="Collapsed">
<nsl:PrestatiesUC></nsl:PrestatiesUC>
</controls:TabItem>
<controls:TabItem Header="Protocollen" x:Name="TabProt" Visibility="Collapsed">
<nsl:ProtocollenUC></nsl:ProtocollenUC>
</controls:TabItem>
<controls:TabItem Header="Adt" x:Name="TabAdt" Visibility="Collapsed">
<nsl:AdtUC></nsl:AdtUC>
</controls:TabItem>
</controls:TabControl>
And in my PrestatiesUC usercontrol i have an object:
<Button x:Name="btnReSend" Content="Resend" Width="75" Height="25" Margin="10" Click="resend_Button"/>
How would I go about disabling it's visibility on startup dynamicly in the main usercontrol code?
I tried things like:
PrestatiesBAMUC tmp = new PrestatiesBAMUC();
tmp.btnReSend.Visibility = Visibility.Collapsed;
But this didn't work.
Any ideas?