You can replace the ListBox ItemsSource="{Binding ElementName=MyMap, Path=Layers.[DynamicLayerCalifornia].Layers}" with an instance of ObservableCollection<LayerInfo> that gets populated when dynamic layer is initialized. Set the dynamic layer's VisibleLayers to an empty int[]. You also need to remove IsChecked="{Binding DefaultVisibility}" from the CheckBox.With these minor tweaks in the sample, you can control the sublayer visibility using the listbox.
<ListBox Margin="0,5,0,0"
x:Name="LayerList"
Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="2"
Name="DynamicLayerCalifornia"
Content="{Binding Name}"
Tag="{Binding ID}"
ClickMode="Press"
Click="CheckBox_Click" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
private ObservableCollection<LayerInfo> layers = new ObservableCollection<LayerInfo>();
public MainPage()
{
InitializeComponent();
this.LayerList.ItemsSource = layers;
}
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{
ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer dynamicServiceLayer =
sender as ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer;
foreach (LayerInfo l in dynamicServiceLayer.Layers)
layers.Add(l);
dynamicServiceLayer.VisibleLayers = new int[] { };
}