AnsweredAssumed Answered

100.3.0 Graphic Attributes Bug

Question asked by CSMike_PDX on Aug 23, 2018
Latest reply on Aug 23, 2018 by JNery-esristaff

If I create an instance of  Esri.ArcGISRuntime.UI.Graphic and add an attribute to it, in which the value of the attribute is a member of an enum, the graphic will not be successfully added to the graphics collection of an overlay.  It fails silently and and I'll see this in the output window at debug time:  

Exception thrown: 'System.NotSupportedException' in Esri.ArcGISRuntime.dll
Error: 'Specified method is not supported.'

 

Code that doesn't work:

var sketchGraphic = new Esri.ArcGISRuntime.UI.Graphic(geometry, symbol);
sketchGraphic.Attributes.Add(_adHocGraphicTypeAttributeName, AdHocGraphicTypeEnum.UserSketch);
sketchOverlay.Graphics.Add(sketchGraphic);

 

Code that does work:

var sketchGraphic = new Esri.ArcGISRuntime.UI.Graphic(geometry, symbol);
sketchGraphic.Attributes.Add(_adHocGraphicTypeAttributeName, 1);
sketchOverlay.Graphics.Add(sketchGraphic);

 

The enum above is defined as:

public enum AdHocGraphicTypeEnum
{
   Unknown = 0,
   UserSketch = 1,
   Buffer = 2
}

Outcomes