Hi,I have the following template for layers in the TOC:
<esri:Legend.LayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!--Busy indicator-->
<ContentControl ContentTemplate="{StaticResource BusyIndicatorTemplate}"
Visibility="{Binding BusyIndicatorVisibility}"/>
<CheckBox
ToolTipService.ToolTip="{Binding localizationResources.strShowlayer}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
<Image x:Name="imgZoomTo" Source="/MIB.Map.Presentation;component/Images/zoom.png"
DataContext="{Binding ElementName=Toc,Path=ViewModel}"
ToolTipService.ToolTip="Zoom"
Tag="{Binding Content, ElementName=lblLayerName}"
Cursor="Hand">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding ZoomToCommand}"
CommandParameter="{Binding ElementName=imgZoomTo}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
<RadioButton x:Name="rbLayer"
DataContext="{Binding ElementName=Toc,Path=ViewModel}"
IsChecked="False"
GroupName="grpSelectedLayer"
Tag="{Binding Content, ElementName=lblLayerName}"
ToolTipService.ToolTip="{Binding localizationResources.strSelectLayer}"
Content="" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding RadioButtonCheckedCommand}"
CommandParameter="{Binding ElementName=rbLayer}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<sdk:Label x:Name="lblLayerName"
Content="{Binding Label}">
<ToolTipService.ToolTip>
<StackPanel MaxWidth="400">
<TextBlock FontWeight="Bold" Text="{Binding Layer.ID}" TextWrapping="Wrap" />
<TextBlock FontWeight="Bold" Text="{Binding Label}" TextWrapping="Wrap" />
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
<TextBlock Text="{Binding MinimumResolution, StringFormat='Minimum Resolution : {0:F6}'}" />
<TextBlock Text="{Binding MaximumResolution, StringFormat='Maximum Resolution : {0:F6}'}" />
</StackPanel>
</ToolTipService.ToolTip>
</sdk:Label>
</StackPanel>
</DataTemplate>
</esri:Legend.LayerTemplate>
In this template, there is a RadioButton control called "rbLayer". In code-behind, I would like to control the visibility of that control. My question is: how do I get a hold of that control so that I can change its visibility?Thanks,Paul