Ejemplo n.º 1
0
        private void MapSeriesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.MapSeriesListBox.SelectedIndex == -1)
            {
                return;
            }

            this.MapLayerControls.Visibility = Visibility.Collapsed;
            var mapLayer        = e.AddedItems[0];
            var mapLayerBinding = new Binding {
                Source = mapLayer, Mode = BindingMode.OneWay
            };
            GeoMapLayerEditor mapLayerEditor;

            if (mapLayer is GeoSymbolProportionalMapLayer)
            {
                ShowMapEditor(mapLayer as GeoSymbolProportionalMapLayer);
            }

            else if (mapLayer is GeoShapeMapLayer)
            {
                ShowMapEditor(mapLayer as GeoShapeMapLayer);
            }

            else if (mapLayer is GeoTileImageryMapLayer)
            {
                ShowMapEditor(mapLayer as GeoTileImageryMapLayer);
            }

            else if (mapLayer is GeoHighDensityScatterMapLayer)
            {
                ShowMapEditor(mapLayer as GeoHighDensityScatterMapLayer);
            }

            else if (mapLayer is GeoScatterAreaMapLayer)
            {
                mapLayerEditor = new GeoScatterAreaLayerEditor();
                mapLayerEditor.SetBinding(GeoMapLayerEditor.MapLayerProperty, mapLayerBinding);
                this.MapLayerControls.Child      = mapLayerEditor;
                this.MapLayerControls.Visibility = Visibility.Visible;
            }
            else if (mapLayer is GeoMotionMapLayer)
            {
                mapLayerEditor = new GeoMotionFrameworkLayerEditor();
                mapLayerEditor.SetBinding(GeoMapLayerEditor.MapLayerProperty, mapLayerBinding);
                this.MapLayerControls.Child      = mapLayerEditor;
                this.MapLayerControls.Visibility = Visibility.Visible;
            }

            else if (mapLayer is GeoSymbolMapLayer)
            {
                ShowMapEditor(mapLayer as GeoSymbolMapLayer);
            }
        }
Ejemplo n.º 2
0
 private void ShowMapEditor(GeoSymbolMapLayer mapLayer)
 {
     if (mapLayer.DataViewSource is AirlineTrafficDataViewSource)
     {
         var mapLayerBinding = new Binding {
             Source = mapLayer, Mode = BindingMode.OneWay
         };
         var mapLayerEditor = new GeoMotionFrameworkLayerEditor();
         mapLayerEditor.SetBinding(GeoMapLayerEditor.MapLayerProperty, mapLayerBinding);
         this.MapLayerControls.Child      = mapLayerEditor;
         this.MapLayerControls.Visibility = Visibility.Visible;
     }
 }