${ui_action_DrawEventArgs_Title}。

${ui_action_DrawEventArgs_Description}

Inheritance: System.EventArgs
 private void OnDrawComplete(DrawEventArgs args)
 {
     if (DrawCompleted != null)
     {
         DrawCompleted(this , args);
     }
 }
        private void node_DrawCompleted(object sender, DrawEventArgs e)
        {
            if (this.pathPonit.IsChecked.Value)
            {
                //标记途经结点顺序
                i++;
                //将结点以图钉样式加到ElementsLayer上
                Pushpin pushpin = new Pushpin()
                {
                    Location = e.Geometry.Bounds.Center,
                    Content = i.ToString(),
                };
                elementsLayer.AddChild(pushpin);
                //用points数组记录结点坐标
                points.Add(pushpin.Location);
            }

            if (this.barrierPoint.IsChecked.Value)
            {
                Pushpin pushpin = new Pushpin()
                {
                    Location = e.Geometry.Bounds.Center,
                    Content = "Stop",
                    FontSize = 8,
                    Background = new SolidColorBrush(Colors.Black),
                };
                elementsLayer.AddChild(pushpin);
                //用MyBarrierPoint数组记录结点坐标
                barrierPoints.Add(pushpin.Location);
            }
        }
 async void dp_DrawCompleted(object sender, DrawEventArgs e)
 {
     if (e.Geometry == null)
     {
         return;
     }
     GetFeaturesByBufferParameters param = new GetFeaturesByBufferParameters
     {
         DatasetNames = new List<string> { "World:Countries" },
         BufferDistance = 10,
         Geometry = e.Geometry,
     };
     //与服务器交互
     try
     {
         GetFeaturesByBufferService ser = new GetFeaturesByBufferService(url);
         var result = await ser.ProcessAsync(param);
         if (result != null)
         {
             featureslayer.AddFeatureSet(result.Features);
         }
     }
     //与服务器交互失败
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        async void DrawCompleted(object sender, DrawEventArgs e)
        {
            if (e.Geometry == null)
            {
                return;
            }

            GetFeaturesByGeometryParameters param = new GetFeaturesByGeometryParameters
            {
                DatasetNames = new List<string> { "World:Countries" },
                SpatialQueryMode = SpatialQueryMode.INTERSECT,
                Geometry = e.Geometry
            };
            //与服务端交互
            try
            {
                GetFeaturesByGeometryService service = new GetFeaturesByGeometryService(url);
                var result = await service.ProcessAsync(param);
                featureslayer.ClearFeatures();
                if (result != null)
                {
                    featureslayer.AddFeatureSet(result.Features);
                }
                else
                {
                    await MessageBox.Show("查询结果为空!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 void region_DrawCompleted(object sender, DrawEventArgs e)
 {
     Feature feature = new Feature();
     feature.Geometry = e.Geometry;
     restLayer.ClipRegion = e.Geometry as GeoRegion;
     restLayer.Refresh();
     this.MyMap.Action = new Pan(this.MyMap);
 }
 private void Line_DrawLineCompleted(object sender, DrawEventArgs e)
 {
    // _eLayer.AddChild(e.Element);
     Feature f = new Feature
     {
         Geometry = e.Geometry
     };
     _fLayer.AddFeature(f);
 }
        //绘制线结束后将所绘制的线转化为线元素并加载到ElementsLayer中,在加载前先设置线元素样式
        private void line_DrawCompleted(object sender , DrawEventArgs e)
        {
            //设置线元素样式
            Feature feature = new Feature
            {
                Geometry = e.Geometry
            };

            this.featuresLayer.AddFeature(feature);
        }
        private void Point_DrawCompleted(object sender, DrawEventArgs e)
        {
            Feature feature = new Feature
            {
                Geometry = e.Geometry
            };


            _fLayer.AddFeature(feature);
            
            //_elayer .AddChild(e.Element);
        }
        /// <summary>
        /// ${ui_action_DrawPoint_event_OnTapped_D}
        /// </summary>
        public override void OnTapped(TappedRoutedEventArgs e)
        {
            base.OnTapped(e);
            Point2D center = Map.ScreenToMap(e.GetPosition(Map));
            DrawEventArgs args = new DrawEventArgs
            {
                DrawName = Name,
                Element = new Pushpin { Location = center },
                Geometry = new GeoPoint(center.X, center.Y)
            };
            OnDrawComplete(args);

        }
        private void node_DrawCompleted(object sender, DrawEventArgs e)
        {
            //标记途经结点顺序
            i++;

            //将结点以图钉样式加到ElementsLayer上
            Pushpin pushpin = new Pushpin();
            pushpin.Location = e.Geometry.Bounds.Center;
            pushpin.Content = i.ToString();
            elementsLayer.AddChild(pushpin);

            //用points数组记录结点坐标
            points.Add(pushpin.Location);
        }
        private void line_DrawCompleted(object sender, DrawEventArgs e)
        {
            if (e.Geometry == null)
            {
                return;
            }

            //将线标绘在客户端要素图层
            PredefinedLineStyle lineStyle = new PredefinedLineStyle { Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 3 };
            Feature feature = new Feature
            {
                Geometry = e.Geometry,
                Style = lineStyle
            };
            featuresLayer.Features.Add(feature);

            Measure(e.Geometry);
        }
        private void node_DrawCompleted(object sender, DrawEventArgs e)
        {
            //标记服务区站点;

            //将站点以图钉样式加到ElementsLayer上
            Pushpin pushpin = new Pushpin();
            pushpin.Location = e.Geometry.Bounds.Center;
            pushpin.Content = (points.Count + 1).ToString();
            pushpin.Background = new SolidColorBrush(Colors.Red);
            elementsLayer.AddChild(pushpin);

            //用points数组记录结点坐标
            points.Add(pushpin.Location);





        }
        private void node_DrawCompleted(object sender, DrawEventArgs e)
        {
            Pushpin pushpin = new Pushpin();
            

            //将事件点以图钉样式加到ElementsLayerE上
            if (eventPonit.IsChecked == true)
            {
                //因为事件点只有一个,因此判断是否存在事件点,如果存在就先将以前的事件点删除
                if (flag == true)
                {
                    elementsLayerE.Children.Clear();
                    featuresLayer.ClearFeatures();
                }
                pushpin.Location = e.Geometry.Bounds.Center;
                pushpin.Content = "E";
                pushpin.Background = new SolidColorBrush(Colors.Red);
                elementsLayerE.AddChild(pushpin);
                flag = true;

                //记录事件点坐标
                eventp = pushpin.Location;
            }

            //将设施点以图钉样式加到ElementsLayer上
            if (FacilityPoint.IsChecked == true)
            {
                pushpin.Location = e.Geometry.Bounds.Center;
                pushpin.Content = "F";
                pushpin.Background = new SolidColorBrush(Colors.Purple);
                elementsLayerF.AddChild(pushpin);

                //用 points 数组记录设施点坐标
                points.Add(pushpin.Location);
            }
        }
 private void endDraw(double radius, bool isCancel = false)
 {
     if (this.ellipse != null)
     {
         //Point2D item = Map.ScreenToMap(e.GetPosition(Map));
         Rectangle2D b = ElementsLayer.GetBBox(ellipse);
         DrawEventArgs args2 = new DrawEventArgs
         {
             DrawName = Name,
             Element = ellipse, //可以由它的bbox得到半径
             Geometry = new GeoCircle(new Point2D(startPt.X, startPt.Y), radius), //返回圆的中心点
             Canceled = isCancel
         };
         Deactivate();
         OnDrawComplete(args2);
     }
 }
 //绘制自由面结束后将所绘制的自由面转化为面元素并加载到ElementsLayer中
 private void polygon_DrawCompleted(object sender , DrawEventArgs e)
 {
     this.elementsLayer.AddChild(e.Element as PolygonElement);
 }
 //绘制点结束后将所绘制的点转化为图钉并加载到ElementsLayer中,在加载前先设置点要素样式
 private void point_DrawCompleted(object sender , DrawEventArgs e)
 {
     this.elementsLayer.AddChild(e.Element as Pushpin);
 }
        //绘制圆结束后将所绘制的圆转化为椭圆(silverlight的元素)并加载到ElementsLayer中,在加载前先设置该元素样式
        private void circle_DrawCompleted(object sender , DrawEventArgs e)
        {
            Ellipse ellipse = e.Element as Ellipse;

            //将椭圆加载到ElementsLayer中
            this.elementsLayer.Children.Add(ellipse);
        }
        //绘制矩形结束后将所绘制的矩形转化为面元素并加载到ElementsLayer中,在加载前先设置该元素样式
        private void rectangle_DrawCompleted(object sender , DrawEventArgs e)
        {
            Feature feature = new Feature
            {
                Geometry = e.Geometry
            };

            this.featuresLayer.AddFeature(feature);
        }
        //绘制面结束后将所绘制的面转化为矢量要素并加载到矢量要素图层中
        private void polygon_DrawCompleted(object sender, DrawEventArgs e)
        {
            //将绘制面转化为面要素并加载到矢量要素图层中
            Feature feature = new Feature()
            {
                Geometry = e.Geometry as GeoRegion,
                Style = new PredefinedFillStyle 
                {
                    Fill = regionColor1
                }
            };

            regionLayer.Features.Add(feature);
            region = e.Geometry as GeoRegion;

            Check();
        }
        private void endDraw(bool isCancel = false)
        {
            if (_points != null)
            {
                while (_points.Count > _pointsCount)
                {
                    _points.RemoveAt(_points.Count - 2);
                }
                PolygonElement pRegion = new PolygonElement()
                {
                    Point2Ds = _points.Clone(),//不克隆,在返回后还与下面的GeoRegion指向一个内存地址
                    #region 所有风格的控制
                    Stroke = this.Stroke,
                    StrokeThickness = this.StrokeThickness,
                    StrokeMiterLimit = this.StrokeMiterLimit,
                    StrokeDashOffset = this.StrokeDashOffset,
                    StrokeDashArray = this.StrokeDashArray,
                    StrokeDashCap = this.StrokeDashCap,
                    StrokeEndLineCap = this.StrokeEndLineCap,
                    StrokeLineJoin = this.StrokeLineJoin,
                    StrokeStartLineCap = this.StrokeStartLineCap,
                    Opacity = this.Opacity,
                    Fill = this.Fill,
                    FillRule = this.FillRule
                    #endregion
                };//构造返回Element对象

                GeoRegion geoRegion = new GeoRegion();//构造返回的Geometry

                geoRegion.Parts.Add(_points);

                DrawEventArgs args = new DrawEventArgs
                {
                    DrawName = Name,
                    Element = pRegion,    //Element = this.polyline  //直接返回是固定像素的
                    Geometry = geoRegion,
                    Canceled = isCancel
                };

                Deactivate();
                OnDrawCompleted(args);
            }
        }
        public override void OnPointerReleased(PointerRoutedEventArgs e)
        {
            if (this.points != null)
            {
                GeoRegion geoRegion = new GeoRegion();
                points.Add(a0);
                geoRegion.Parts.Add(points);

                PolygonElement pPen = new PolygonElement()
                {
                    Point2Ds = points,
                    #region 所有风格的控制
                    Stroke = this.Stroke,
                    StrokeThickness = this.StrokeThickness,
                    StrokeMiterLimit = this.StrokeMiterLimit,
                    StrokeDashOffset = this.StrokeDashOffset,
                    StrokeDashArray = this.StrokeDashArray,
                    StrokeDashCap = this.StrokeDashCap,
                    StrokeEndLineCap = this.StrokeEndLineCap,
                    StrokeLineJoin = this.StrokeLineJoin,
                    StrokeStartLineCap = this.StrokeStartLineCap,
                    Opacity = this.Opacity,
                    Fill = this.Fill,
                    FillRule = this.FillRule
                    #endregion
                };

                DrawEventArgs args2 = new DrawEventArgs
                {
                    DrawName = Name,
                    Element = pPen,
                    Geometry = geoRegion
                };

                Deactivate();
                OnDrawComplete(args2);
            }
            e.Handled = true;
            base.OnPointerReleased(e);
        }
 private void star_DrawCompleted(object sender, DrawEventArgs e)
 {
     elementslayer.AddChild(e.Element);
 }
        //几何对象绘制结束触发事件
        private async void DrawCompleted(object sender, DrawEventArgs e)
        {


            //设置几何查询参数,FilterParameters、Geometry 和 SpatialQueryMode 为必设属性
            QueryByGeometryParameters parameter = new QueryByGeometryParameters
            {
                FilterParameters = new List<FilterParameter>() 
                {             
                        new FilterParameter()
                       {
                           Name = "Countries@World",                          
                       }
                },
                Geometry = e.Geometry,
                SpatialQueryMode = SpatialQueryMode.INTERSECT,

                //设置是返回查询结果资源(false)还是返回查询结果记录集(true)
                ReturnContent = notHighlight
            };

            //与服务器交互
            try
            {
                QueryByGeometryService service = new QueryByGeometryService(url);
                var result = await service.ProcessAsync(parameter);
                //无查询结果的情况
                if (result == null)
                {
                    await MessageBox.Show("查询结果为空!");
                    return;
                }

                //如果当前矢量图层中存在上一次的查询地物,则清除
                if (flayer.Features.Count > 0)
                {
                    flayer.Features.Clear();
                }

                highlayer.IsVisible = false;
                highlayer.Refresh();

                //当 ReturnContent = false 且有查询结果时,返回结果中的 ResourceInfo 不为空
                //当 ReturnContent = true 且有查询结果时,返回结果中的 Recordsets 不为空,ResourceInfo 为空
                if (result.ResourceInfo != null)
                {
                    highlayer.IsVisible = true;

                    //获取高亮图片在服务器上存储的资源 ID 号
                    highlayer.QueryResultID = result.ResourceInfo.NewResourceID;

                    //设置服务端高亮图层的样式
                    highlayer.Style = new ServerStyle() { FillForeColor = new Color { R = 0, G = 160, B = 0 }, LineWidth = 0, FillOpaqueRate = 90 };

                    //该判断控制只加载一个高亮图层
                    if (!isAdded)
                    {
                        //刷新高亮图层
                        highlayer.Refresh();
                        this.MyMap.Layers.Add(highlayer);
                        isAdded = true;
                    }
                }
                else
                {


                    //将查询结果记录集中的数据转换为矢量要素并在矢量图层中显示
                    foreach (Recordset recordset in result.Recordsets)
                    {
                        foreach (Feature f in recordset.Features)
                        {
                            flayer.Features.Add(f);
                        }
                    }

                    //将查询到的地物赋予 XMAL 中自定义样式
                    foreach (Feature item in flayer.Features)
                    {
                        if (item.Geometry is GeoLine)
                        {
                            item.Style = LineSelectStyle;
                        }
                        else if (item.Geometry is GeoRegion)
                        {
                            item.Style = SelectStyle;
                        }
                        else
                        {
                            item.Style = new PredefinedMarkerStyle() { Color = new SolidColorBrush(Colors.Blue), Size = 20, Symbol = PredefinedMarkerStyle.MarkerSymbol.Diamond };
                        }
                    }
                }
            }
            //服务器查询失败
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void endDraw(bool isCancel = false)
        {
            if (rectangle != null)
            {
                Rectangle2D bounds = (Rectangle2D)rectangle.GetValue(ElementsLayer.BBoxProperty);
                if (Rectangle2D.IsNullOrEmpty(bounds) || bounds.Width == 0.0 || bounds.Height == 0.0)
                {
                    return;
                }

                //GeoRegion geoRegion = new GeoRegion();//构造返回的Geometry
                //Point2DCollection geoPoints = new Point2DCollection();
                //geoPoints.Add(bounds.BottomLeft);
                //geoPoints.Add(new Point2D(bounds.Right, bounds.Bottom));
                //geoPoints.Add(bounds.TopRight);
                //geoPoints.Add(new Point2D(bounds.Left, bounds.Top));
                //geoPoints.Add(bounds.BottomLeft);//需要添加起始点做为最后一个点
                //geoRegion.Parts.Add(geoPoints);
                GeoRegion geoRegion = bounds.ToGeoRegion();

                DrawEventArgs args2 = new DrawEventArgs
                {
                    DrawName = this.Name,
                    Element = this.rectangle,
                    Geometry = geoRegion,
                    Canceled = isCancel
                };

                Deactivate();
                OnDrawCompleted(args2);
            }
        }
        private void endDraw(bool isCancel = false)
        {
            if (points != null)
            {
                PolylineElement pLine = new PolylineElement()
                {
                    Point2Ds = points.Clone(),
                    #region 所有风格的控制
                    Stroke = this.Stroke,
                    StrokeThickness = this.StrokeThickness,
                    StrokeMiterLimit = this.StrokeMiterLimit,
                    StrokeDashOffset = this.StrokeDashOffset,
                    StrokeDashArray = this.StrokeDashArray,
                    StrokeDashCap = this.StrokeDashCap,
                    StrokeEndLineCap = this.StrokeEndLineCap,
                    StrokeLineJoin = this.StrokeLineJoin,
                    StrokeStartLineCap = this.StrokeStartLineCap,
                    Opacity = this.Opacity,
                    Fill = this.Fill,
                    FillRule = this.FillRule
                    #endregion
                };
                GeoLine geoLine = new GeoLine();//构造返回的Geometry
                geoLine.Parts.Add(points);
                DrawEventArgs args = new DrawEventArgs
                {
                    DrawName = Name,
                    Element = pLine,
                    Geometry = geoLine,
                    Canceled = isCancel
                };

                Deactivate();
                OnDrawCompleted(args);
            }
        }
        private void polygon_DrawCompleted(object sender, DrawEventArgs e)
        {
            if (e.Geometry == null)
            {
                return;
            }

            //将面标绘在客户端任意图层
            PolygonElement polygon = e.Element as PolygonElement;
            polygon.Opacity = 0.618;
            polygon.StrokeThickness = 1;
            polygon.Fill = new SolidColorBrush(Colors.LightGray);
            this.elementsLayer.Children.Add(polygon);

            Measure(e.Geometry);
        }
        //几何对象绘制结束触发事件
        private async void drawCompleted(object sender, DrawEventArgs e)
        {
            double tolerance;



            //如果距离值为空时,默认为1地图单位
            if (!double.TryParse(MyTextBox.Text, out tolerance))
            {
                tolerance = 1;
            }

            //如果查找最近地物,只返回一个期望地物
            if ((bool)FindNearest.IsChecked)
            {
                count = 1;
            }
            else
            {
                count = 100000;
            }

            //设置距离查询参数,FilterParameters和Geometry为必设属性
            QueryByDistanceParameters param = new QueryByDistanceParameters
            {
                Geometry = e.Geometry,
                ExpectCount = count,
                Distance = tolerance,
                IsNearest = (bool)FindNearest.IsChecked,
                FilterParameters = new List<FilterParameter>() 
                { 
                    new FilterParameter(){Name = "Countries@World",}, 
                },

                //设置是返回查询结果资源(false)还是返回查询结果记录集(true)
                ReturnContent = notHighlight
            };
            try
            {
                QueryByDistanceService service = new QueryByDistanceService(url);
                var result = await service.ProcessAsync(param);

                //无查询结果的情况
                if (result == null)
                {
                    await MessageBox.Show("查询结果为空!");
                    return;
                }

                //如果当前矢量图层中存在上一次的查询地物,则清除
                if (flayer.Features.Count > 0)
                {
                    flayer.Features.Clear();
                }
                highlayer.IsVisible = false;
                highlayer.Refresh();

                if (result.ResourceInfo != null)
                {
                    highlayer.IsVisible = true;

                    //获取高亮图片在服务器上存储的资源 ID 号
                    highlayer.QueryResultID = result.ResourceInfo.NewResourceID;

                    //设置服务端高亮图层的样式
                    highlayer.Style = new ServerStyle() { FillForeColor = new Color { R = 0, G = 160, B = 0 }, LineWidth = 0, FillOpaqueRate = 90 };

                    //该判断控制只加载一个高亮图层
                    if (!isAdded)
                    {

                        //刷新高亮图层
                        highlayer.Refresh();
                        this.MyMap.Layers.Add(highlayer);
                        isAdded = true;
                    }
                }
                else
                {
                    //将查询结果记录集中的数据转换为矢量要素并在矢量图层中显示
                    foreach (Recordset recordset in result.Recordsets)
                    {
                        foreach (Feature f in recordset.Features)
                        {
                            flayer.Features.Add(f);
                        }
                    }

                    //将查询到的地物赋予 XMAL 中自定义样式
                    foreach (Feature item in flayer.Features)
                    {
                        if (item.Geometry is GeoLine)
                        {
                            item.Style = LineSelectStyle;
                        }
                        else if (item.Geometry is GeoRegion)
                        {
                            item.Style = SelectStyle;
                        }
                        else
                        {
                            item.Style = new PredefinedMarkerStyle() { Color = new SolidColorBrush(Colors.Blue), Size = 20, Symbol = PredefinedMarkerStyle.MarkerSymbol.Diamond };
                        }
                    }
                }
            }
            //服务器查询失败
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }