Exemplo n.º 1
0
        public override void Execute(object parameter)
        {
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;

            if (graphicsLayer == null)
            {
                return;
            }

            if (layerSymbologyConfigControl != null)
            {
                MapApplication.Current.HideWindow(layerSymbologyConfigControl);
            }

            layerSymbologyConfigControl = new LayerSymbologyConfigControl()
            {
                GeometryType         = GeometryType,
                SymbolConfigProvider = SymbolConfigProvider,
                Layer       = Layer,
                ThemeColors = ThemeColors,
            };
            layerSymbologyConfigControl.LayerRendererChanged          += new EventHandler <LayerRendererChangedEventArgs>(layerSymbologyConfigControl_LayerRendererChanged);
            layerSymbologyConfigControl.LayerRendererAttributeChanged += new EventHandler <LayerRendererAttributeChangedEventArgs>(layerSymbologyConfigControl_LayerRendererAttributeChanged);

            MapApplication.Current.ShowWindow(LocalizableStrings.SymbolOptions, layerSymbologyConfigControl, false, null, (o, e) => { if (layerSymbologyConfigControl != null)
                                                                                                                                      {
                                                                                                                                          layerSymbologyConfigControl.CloseAllPopups();
                                                                                                                                      }
                                                                                                                                      layerSymbologyConfigControl = null; });
        }
        public static void OnSymbolConfigProviderChange(DependencyObject o, DependencyPropertyChangedEventArgs args)
        {
            LayerSymbologyConfigControl control = o as LayerSymbologyConfigControl;

            if (control != null)
            {
                control.bindUIToLayer();
            }
        }
 void rendererButton_Click(object sender, RoutedEventArgs e)
 {
     if (symbologyConfigDialog == null)
     {
         symbologyConfigDialog = new LayerSymbologyConfigControl() { 
             Margin = new Thickness(10),
             SymbolConfigProvider = View.Instance.SymbolConfigProvider,
             ThemeColors = View.Instance.ThemeColors
         };
     }
     ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetGeometryType(Layer, GeometryType);
     symbologyConfigDialog.Layer = Layer;
     MapApplication.Current.ShowWindow(Strings.ConfigureRenderer, symbologyConfigDialog, true);
 }
        public override void Execute(object parameter)
        {
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;
            if (graphicsLayer == null)
                return;

            if (layerSymbologyConfigControl != null)
                MapApplication.Current.HideWindow(layerSymbologyConfigControl);

            layerSymbologyConfigControl = new LayerSymbologyConfigControl()
            { 
                 GeometryType = GeometryType,
                 SymbolConfigProvider = SymbolConfigProvider,
                 Layer = Layer,
                 ThemeColors = ThemeColors,
            };
            layerSymbologyConfigControl.LayerRendererChanged += new EventHandler<LayerRendererChangedEventArgs>(layerSymbologyConfigControl_LayerRendererChanged);
            layerSymbologyConfigControl.LayerRendererAttributeChanged += new EventHandler<LayerRendererAttributeChangedEventArgs>(layerSymbologyConfigControl_LayerRendererAttributeChanged);

            MapApplication.Current.ShowWindow(LocalizableStrings.SymbolOptions, layerSymbologyConfigControl, false, null, (o, e) => { if (layerSymbologyConfigControl != null) layerSymbologyConfigControl.CloseAllPopups(); layerSymbologyConfigControl = null; });            
        }