private void ToolMenuButton_SelectedButtonChange(object sender, MenuButtonChangeEventArgs e)
 {
     if (e.NewButton != null)
     {
         toolMode = (MapActionMode)Enum.Parse(typeof(MapActionMode), (string)e.NewButton.Tag, true);
         this.ResetDrawObjectMode();
     }
 }
        private void BaseMenuButton_SelectedButtonChange(object sender, MenuButtonChangeEventArgs e)
        {
            if (e.NewButton != null && e.OldButton != null)
            {
                LayerConfig oldLayerConfig = (LayerConfig)e.OldButton.Tag;
                LayerConfig newLayerConfig = (LayerConfig)e.NewButton.Tag;

                this.MapControl.Layers[oldLayerConfig.ID].Visible = false;
                this.MapControl.Layers[newLayerConfig.ID].Visible = true;

                BaseMapConfig baseConfig = AppConfig.MapConfig.BaseMap;
                if (baseConfig.EnableBase == ServiceSource.ArcGIS && baseConfig.ArcGISBaseMap.LabelLayer != null)
                {
                    string layerID = AppConfig.MapConfig.BaseMap.ArcGISBaseMap.LabelLayer.ID;
                    this.MapControl.Layers[layerID].Visible = (newLayerConfig as ArcGISBaseMapLayer).ShowLabel;
                }

                EventCenter.DispatchBaseMapLayerChangeEvent(this, new BaseMapLayerChangeEventArgs(newLayerConfig.ID));
            }
        }