Ejemplo n.º 1
0
 protected virtual void OnSymolChanged(SymbolSelectedEventArgs args)
 {
     if (SymbolModified != null)
     {
         SymbolModified(this, args);
     }
 }
Ejemplo n.º 2
0
 void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     if (SymbolDisplay != null)
         SymbolDisplay.Symbol = Symbol;
     OnSymbolSelected(e);
 }
 protected virtual void OnDefaultSymbolModified(SymbolSelectedEventArgs e)
 {
     if (DefaultSymbolModified != null)
     {
         DefaultSymbolModified(this, e);
     }
 }
Ejemplo n.º 4
0
 private void OnSymbolSelected(SymbolSelectedEventArgs e)
 {
     if (SymbolSelected != null)
     {
         SymbolSelected(this, e);
     }
 }
 protected void OnSymbolSelected(SymbolSelectedEventArgs args)
 {
     if (SymbolSelected != null)
     {
         SymbolSelected(this, args);
     }
 }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValueRenderer != null)
            {
                UniqueValueRenderer.DefaultSymbol = e.Symbol;
            }

            OnUniqueValueRendererModified(EventArgs.Empty);
        }
 void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     if (SymbolDisplay != null)
     {
         SymbolDisplay.Symbol = Symbol;
     }
     OnSymbolSelected(e);
 }
Ejemplo n.º 8
0
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreaksRenderer != null)
            {
                ClassBreaksRenderer.DefaultSymbol = e.Symbol;
            }

            OnClassBreakRendererModified(EventArgs.Empty);
        }
        void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValue != null)
            {                
                UniqueValue.Symbol = e.Symbol;
            }

            if (SymbolDisplay != null)
                SymbolDisplay.Symbol = e.Symbol;

            OnUniqueValueModified(new UniqueValueModifiedEventArgs() { UniqueValue = UniqueValue, UniqueValueModificationType = UniqueValueModificationType.SymbolChanged });
        }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreaksRenderer != null)
            {
                ClassBreaksRenderer.DefaultSymbol = e.Symbol;
            }

            bool isSelectedItem = ClassBreakConfigItems.SelectedItem == sender;

            OnClassBreakRendererModified(new SelectedClassBreakModificationEventArgs()
            {
                ClassBreakModificationType = ClassBreakModificationType.SymbolChanged, IsSelectedItem = isSelectedItem
            });
        }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValueRenderer != null)
            {
                UniqueValueRenderer.DefaultSymbol = e.Symbol;
            }

            bool isSelectedItem = UniqueValueConfigItems.SelectedItem == sender;

            OnUniqueValueRendererModified(new SelectedUniqueValueModificationEventArgs()
            {
                UniqueValueModificationType = UniqueValueModificationType.SymbolChanged,
                UniqueValue    = null,
                IsSelectedItem = isSelectedItem,
            });
        }
        void defaultSymbolConfig_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;

            if (graphicsLayer == null)
            {
                return;
            }

            graphicsLayer.ChangeRenderer(e.Symbol);
            refreshLayer();
            if (SymbolConfigControl != null)
            {
                SymbolConfigControl.Symbol = e.Symbol;
            }
        }
        void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValue != null)
            {
                UniqueValue.Symbol = e.Symbol;
            }

            if (SymbolDisplay != null)
            {
                SymbolDisplay.Symbol = e.Symbol;
            }

            OnUniqueValueModified(new UniqueValueModifiedEventArgs()
            {
                UniqueValue = UniqueValue, UniqueValueModificationType = UniqueValueModificationType.SymbolChanged
            });
        }
Ejemplo n.º 14
0
        void SymbolSelector_SymbolChanged(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreak != null)
            {
                ClassBreak.Symbol = e.Symbol;
            }

            if (SymbolDisplay != null)
            {
                SymbolDisplay.Symbol = e.Symbol;
            }

            OnClassBreakModified(new ClassBreakModificationEventArgs()
            {
                ClassBreakModificationType = ClassBreakModificationType.SymbolChanged
            });
        }
        void SymbolConfigControl_SymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            // Some changes to ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleSymbols do not trigger the legendchanged event. Fix this by triggering the event by cloning the symbol.
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;

            if (graphicsLayer != null && graphicsLayer.Renderer is ILegendSupport)
            {
                SimpleRenderer simpleRenderer = graphicsLayer.Renderer as SimpleRenderer;
                if (simpleRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
                {
                    simpleRenderer.Symbol = e.Symbol.CloneSymbol();
                }
                else
                {
                    ClassBreaksRenderer classBreaksRenderer = graphicsLayer.Renderer as ClassBreaksRenderer;
                    if (classBreaksRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
                    {
                        if (_classBreakInfo != null)
                        {
                            _classBreakInfo.Symbol = e.Symbol.CloneSymbol();
                        }
                        else
                        {
                            classBreaksRenderer.DefaultSymbol = e.Symbol.CloneSymbol();
                        }
                    }
                    else
                    {
                        UniqueValueRenderer uniqueValueRenderer = graphicsLayer.Renderer as UniqueValueRenderer;
                        if (uniqueValueRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
                        {
                            if (_uniqueValueInfo != null)
                            {
                                _uniqueValueInfo.Symbol = e.Symbol.CloneSymbol();
                            }
                            else
                            {
                                uniqueValueRenderer.DefaultSymbol = e.Symbol.CloneSymbol();
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 16
0
 protected virtual void OnSymbolSelected(SymbolSelectedEventArgs args)
 {
     if (SymbolSelected != null)
         SymbolSelected(this, args);
 }
 void SymbolPicker_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     OnSymolChanged(e);
     bindUIToSymbol();
 }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValueRenderer != null)
                UniqueValueRenderer.DefaultSymbol = e.Symbol;

            OnUniqueValueRendererModified(EventArgs.Empty);
        }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreaksRenderer != null)
                ClassBreaksRenderer.DefaultSymbol = e.Symbol;

            OnClassBreakRendererModified(EventArgs.Empty);
        }
        void SymbolSelector_SymbolChanged(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreak != null)
            {                
                ClassBreak.Symbol = e.Symbol;
            }

            if (SymbolDisplay != null)
                SymbolDisplay.Symbol = e.Symbol;            

            OnClassBreakModified(new ClassBreakModificationEventArgs() { ClassBreakModificationType = ClassBreakModificationType.SymbolChanged });
        }
 void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     OnDefaultSymbolModified(e);
 }
Ejemplo n.º 22
0
 void MarkerSymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     OnSymbolSelected(e);
 }
Ejemplo n.º 23
0
        private void OnSymbolSelected(SymbolSelectedEventArgs e)
        {
            if (CurrentSymbolImage != null)
            {
                CurrentSymbolImage.Source = new BitmapImage
                {
                    UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative)
                };
            }

            PictureMarkerSymbol Symbol = new PictureMarkerSymbol()
            {
                Source = new BitmapImage()
                {
                    UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative)
                },
                OffsetX = e.SelectedImage.CenterX,
                OffsetY = e.SelectedImage.CenterY,
                Width   = e.SelectedImage.Width,
                Height  = e.SelectedImage.Height,
                Opacity = OpacitySlider.Value,
                // TODO
                //CursorName = DataContext is TableLayerInfo ? Cursors.Hand.ToString() : Cursors.Arrow.ToString()
            };

            GraphicsLayer layer = DataContext as GraphicsLayer;

            if (layer != null)
            {
                // TODO:- verify if we still need this
                //LayerInfo layerInfo = DataContext as LayerInfo;
                //// refresh the graphics layer
                //GraphicsLayer lyr = ApplicationInstance.Instance.FindLayerForLayerInfo(layerInfo) as GraphicsLayer;
                //if (lyr != null)
                //{
                //    ensureCustomClassBreakRendererIsSet(lyr, layerInfo);
                //    CustomClassBreakRenderer cb = lyr.Renderer as CustomClassBreakRenderer;
                //    if (cb != null)
                //    {
                //        ImageFillSymbol imageFillSymbol = cb.DefaultSymbol as ImageFillSymbol;
                //        if (imageFillSymbol != null)
                //        {
                //            imageFillSymbol.Fill = new ImageBrush
                //            {
                //                ImageSource = new BitmapImage
                //                {
                //                    UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative)
                //                }
                //            };
                //            imageFillSymbol.CursorName = DataContext is TableLayerInfo ? Cursors.Hand.ToString() : Cursors.Arrow.ToString();

                //        }
                //    }
                //}

                // update the model
                ClassBreaksRenderer renderer = layer.Renderer as ClassBreaksRenderer;
                if (renderer != null)
                {
                    renderer.DefaultSymbol = Symbol;
                }
            }
            else
            {
                if (SymbolSelected != null)
                {
                    SymbolSelected(this, e);
                }
            }
        }
 protected virtual void OnDefaultSymbolModified(SymbolSelectedEventArgs e)
 {
     if (DefaultSymbolModified != null)
         DefaultSymbolModified(this, e);
 }
 void SymbolConfigControl_SymbolModified(object sender, SymbolSelectedEventArgs e)
 {
     // Some changes to ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleSymbols do not trigger the legendchanged event. Fix this by triggering the event by cloning the symbol.
     GraphicsLayer graphicsLayer = Layer as GraphicsLayer;
     if (graphicsLayer != null && graphicsLayer.Renderer is ILegendSupport)
     {
         SimpleRenderer simpleRenderer = graphicsLayer.Renderer as SimpleRenderer;
         if (simpleRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
             simpleRenderer.Symbol = e.Symbol.CloneSymbol();
         else
         {
             ClassBreaksRenderer classBreaksRenderer = graphicsLayer.Renderer as ClassBreaksRenderer;
             if (classBreaksRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
             {
                 if (_classBreakInfo != null)
                     _classBreakInfo.Symbol = e.Symbol.CloneSymbol();
                 else
                     classBreaksRenderer.DefaultSymbol = e.Symbol.CloneSymbol();
             }
             else
             {
                 UniqueValueRenderer uniqueValueRenderer = graphicsLayer.Renderer as UniqueValueRenderer;
                 if (uniqueValueRenderer != null && (e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleMarkerSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleLineSymbol || e.Symbol is ESRI.ArcGIS.Client.FeatureService.Symbols.SimpleFillSymbol))
                     if (_uniqueValueInfo != null)
                         _uniqueValueInfo.Symbol = e.Symbol.CloneSymbol();
                     else
                         uniqueValueRenderer.DefaultSymbol = e.Symbol.CloneSymbol();
             }
         }
     }
 }
Ejemplo n.º 26
0
 void SymbolPicker_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     OnSymolChanged(e);
     bindUIToSymbol();
 }
 void SymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     Symbol = e.Symbol;
     OnDefaultSymbolModified(e);                        
 }
        void defaultSymbolConfig_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;
            if (graphicsLayer == null)
                return;

            graphicsLayer.ChangeRenderer(e.Symbol);
            refreshLayer();
            if (SymbolConfigControl != null)
                SymbolConfigControl.Symbol = e.Symbol;
        }
 void MarkerSymbolSelector_SymbolSelected(object sender, SymbolSelectedEventArgs e)
 {
     OnSymbolSelected(e);
 }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (ClassBreaksRenderer != null)
                ClassBreaksRenderer.DefaultSymbol = e.Symbol;

            bool isSelectedItem = ClassBreakConfigItems.SelectedItem == sender;

            OnClassBreakRendererModified(new SelectedClassBreakModificationEventArgs() { ClassBreakModificationType = ClassBreakModificationType.SymbolChanged, IsSelectedItem = isSelectedItem });
        }
 private void OnSymbolSelected(SymbolSelectedEventArgs e)
 {
     if (SymbolSelected != null)
         SymbolSelected(this, e);
 }
        private void OnSymbolSelected(SymbolSelectedEventArgs e)
        {
            if (CurrentSymbolImage != null)
            {
                CurrentSymbolImage.Source = new BitmapImage
                {
                    UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative)
                };
            }

            PictureMarkerSymbol Symbol = new PictureMarkerSymbol()
            {
                Source = new BitmapImage() { UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative) },
                OffsetX = e.SelectedImage.CenterX,
                OffsetY = e.SelectedImage.CenterY,
                Width = e.SelectedImage.Width,
                Height = e.SelectedImage.Height,
                Opacity = OpacitySlider.Value,
                // TODO
                //CursorName = DataContext is TableLayerInfo ? Cursors.Hand.ToString() : Cursors.Arrow.ToString()
            };

            GraphicsLayer layer = DataContext as GraphicsLayer;
            if (layer != null)
            {
                // TODO:- verify if we still need this
                //LayerInfo layerInfo = DataContext as LayerInfo;
                //// refresh the graphics layer
                //GraphicsLayer lyr = ApplicationInstance.Instance.FindLayerForLayerInfo(layerInfo) as GraphicsLayer;
                //if (lyr != null)
                //{
                //    ensureCustomClassBreakRendererIsSet(lyr, layerInfo);
                //    CustomClassBreakRenderer cb = lyr.Renderer as CustomClassBreakRenderer;
                //    if (cb != null)
                //    {
                //        ImageFillSymbol imageFillSymbol = cb.DefaultSymbol as ImageFillSymbol;
                //        if (imageFillSymbol != null)
                //        {
                //            imageFillSymbol.Fill = new ImageBrush
                //            {
                //                ImageSource = new BitmapImage
                //                {
                //                    UriSource = new Uri(e.SelectedImage.RelativeUrl, UriKind.Relative)
                //                }
                //            };
                //            imageFillSymbol.CursorName = DataContext is TableLayerInfo ? Cursors.Hand.ToString() : Cursors.Arrow.ToString(); 

                //        }
                //    }
                //}

                // update the model
                ClassBreaksRenderer renderer = layer.Renderer as ClassBreaksRenderer;
                if (renderer != null)
                {
                    renderer.DefaultSymbol = Symbol;
                }
            }
            else
            {
                if (SymbolSelected != null)
                    SymbolSelected(this, e);
            }
        }
        void defaultSymbolConfigControl_DefaultSymbolModified(object sender, SymbolSelectedEventArgs e)
        {
            if (UniqueValueRenderer != null)
                UniqueValueRenderer.DefaultSymbol = e.Symbol;

            bool isSelectedItem = UniqueValueConfigItems.SelectedItem == sender;

            OnUniqueValueRendererModified(new SelectedUniqueValueModificationEventArgs() { 
                UniqueValueModificationType = UniqueValueModificationType.SymbolChanged, 
                UniqueValue = null, 
                IsSelectedItem = isSelectedItem,
            });
        }