Select to view content in your preferred language

ArcGISDynamicMapServiceLayer VisibilityChanged not firing and working

2312
1
12-20-2012 10:36 PM
bayramüçüncü
Deactivated User
ArcGISDynamicMapServiceLayer mapServiceLayer = MyMap.Layers[8] as ArcGISDynamicMapServiceLayer;
mapServiceLayer.VisibilityChanged += (s, e) => System.Windows.MessageBox.Show("ok");


and I have a checkbox that respoisble change the layer vsibility.

            <CheckBox Content="ways"
                      IsChecked="{Binding MyMap.Layers[8].Visible, Mode=TwoWay}"/>


the chechbox working and changing the visibility of layer.
But visibility changed event of ArcGISDynamicMapServiceLayer is not firing.


I put a breakpoint and watched that Layer[8] of MyMap has visibilityChanged event and not null.

[ATTACH=CONFIG]20125[/ATTACH]
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
The VisibilityChanged event occurs when the visibility of the sublayers changed.

When the visibility of the layer changes, the Layer.PropertyChanged event is fired. In your Handler you will have to test that the PropertyName is 'Visible'
0 Kudos