I would need more info on what you want to do.
Let's take an example with the sample you pointed out.
The attached screen shot shows the result when the service's visibility is set to false (layer.Visible = false) and when only 2 of 3 sublayers are set to visible (layer.VisibleLayers= {2, 3} ).
The checkbox of the service is unchecked (seems what you want) but the checkboxes of the sublayers are depending on the VisibleLayers property (despite the fact that none of these sublayers be visible because the layer itself is checked off).
If now you checked on the layer visibility, the sublayers 2 and 3 will be displayed (but the status of the sublayers checkboxes will not change).
I am guessing that you need to show if a sublayer is currently viisble or not. For that, you can use the 'IsVisible' property (which is taking of care of the visibility of all ascendants and is also taking care of the scale).
But this property is Read-Only, so populate the checkbox with this property is probably not the best use case.