private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
// State changed event is sent by a layer. In the list, find the layer which sends this event.
// If it exists then update the status
var model = _layerStatusModels.FirstOrDefault(l => l.LayerName == e.Layer.Name);
if (model != null)
model.LayerViewStatus = e.LayerViewState.Status.ToString();
}