I am using the legend with a template, and I want to be able to tell if one of the layers has been checked on. It is a Query Layer that needs to be refreshed every 5 minutes. I don't want to have the timer working while the layer is turned off, but I am having a difficult time figuring out when it is turned on.
Does anybody know how to tell if a layer has been turned on?
For a map layer (i.e. a layer directlly attached to a map), you can subscribe to event Layer.PropertyChanged and, in your Handler, react accordingly when the changed property is "Visible".
For a sublayer of a dynamic map service, you can subscribe to VisibilityChanged event that occurs when the visibility of a sublayer changes.
For a map layer (i.e. a layer directlly attached to a map), you can subscribe to event Layer.PropertyChanged and, in your Handler, react accordingly when the changed property is "Visible".
For a sublayer of a dynamic map service, you can subscribe to VisibilityChanged event that occurs when the visibility of a sublayer changes.