Select to view content in your preferred language

Programmatically fire DrawComplete Event

949
2
Jump to solution
06-15-2012 06:01 AM
RobertMEIER
Regular Contributor
When drawing a line I want to fire the DrawComplete event after the user clicks a second point, essentially overriding the double-click to end drawing.

this is VB -

it is my understanding that you can finr the event just by doing this: GraphicDrawObject_DrawComplete(Nothing, arg)

the issue is I can't set the geometry of the DrawEventArgs - I get something like this: set accessor of property is not accessible

The documentation say that is is a setable property - below is the code I am tryinh

  Dim pl As ESRI.ArcGIS.Client.Geometry.Polyline = New ESRI.ArcGIS.Client.Geometry.Polyline()
  pl.SpatialReference = MainMap.SpatialReference
  pl.Paths.Add(ptsCurrent)
  Dim arg As ESRI.ArcGIS.Client.DrawEventArgs = New ESRI.ArcGIS.Client.DrawEventArgs()

arg.Geometry = pl (this line error)


  GraphicDrawObject_DrawComplete(Nothing, arg)

Any help is appreciated!

-bert
0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Alum
There is a CompleteDraw() method on the Draw object.  Just call that on your second click and it will fire off the Draw.Complete event.
Thanks,
-Joe

View solution in original post

0 Kudos
2 Replies
JoeHershman
MVP Alum
There is a CompleteDraw() method on the Draw object.  Just call that on your second click and it will fire off the Draw.Complete event.
Thanks,
-Joe
0 Kudos
RobertMEIER
Regular Contributor
Joe, that works!

Thanks for pointing me in that direction.

-bert
0 Kudos