public static ESRI.ArcGIS.Mapping.Core.Symbols.ImageFillSymbol ToImageFillSymbol(
            ESRI.ArcGIS.Client.FeatureService.Symbols.PictureMarkerSymbol pms)
        {
            if (pms != null)
            {
                Symbols.ImageFillSymbol symbol = SymbolFromJson(pms.ToJson()) as Symbols.ImageFillSymbol;

                if (string.IsNullOrEmpty(symbol.ImageData) && string.IsNullOrEmpty(symbol.Source))
                {
                    string imageData = SymbolExtensions.GetImageData(pms);
                    string source;
                    if (string.IsNullOrEmpty(symbol.ImageData) && !string.IsNullOrEmpty(imageData))
                    {
                        symbol.ImageData = imageData;
                    }
                    else if (string.IsNullOrEmpty(symbol.Source) && !string.IsNullOrEmpty(source = SymbolExtensions.GetImageUrl(pms)))
                    {
                        symbol.Source = source;
                    }
                }

                return(symbol);
            }
            return(null);
        }
예제 #2
0
        private static void OnFillChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ImageFillSymbol dp = d as ImageFillSymbol;

            if (dp != null)
            {
                dp.OnPropertyChanged("Fill");
            }
        }
예제 #3
0
        private void changeCursorForSymbol(Symbol symbol, bool isClickableCursor)
        {
            if (symbol == null)
            {
                return;
            }

            ESRI.ArcGIS.Mapping.Core.Symbols.ImageFillSymbol imageFillSymbol = symbol as ESRI.ArcGIS.Mapping.Core.Symbols.ImageFillSymbol;
            if (imageFillSymbol != null)
            {
                imageFillSymbol.CursorName = isClickableCursor ? "Hand" : "Arrow";
            }
        }