Select to view content in your preferred language

Graphic Fills and controltemplates

702
3
11-17-2010 12:24 PM
BenSainsbury
Emerging Contributor
I need some help from someone who knows this better than I do.

My workflow - call up some JSON geometry from a webservice, deserialize into an object, iterate through graphics in the object taking an attribute into account for the graphics' color, add to graphics layer...it's all good.  Note that I am using a different brush for each graphic in order to symbolize a numeric attribute range.

It's all good.

*However* Attaching a symbolic change on mouseover/normal states while maintaining the unique color of each graphic has proven a major hurdle. I was previously using a visual state manager associated with the defaultFillSymbol to symbolize the mouseover/normal states but I cannot figure out a way to "re-use" the visual state manager while persisting the unique graphic colors...

Any thoughts?
Thanks,
Ben
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Would it help to use ClassBreaksRenderer? It has an Attribute property that you can set to decide which Symbol to use based on Minimum and Maximum value.

Kindly refer to the following documentation:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ClassBreak...
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ClassBreak...

Also, please look at this sample:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML
0 Kudos
BenSainsbury
Emerging Contributor
Thanks for the quick response.

One problem, I use linear interpolation to 'transpose' the range. In other words, I don't know if my range is going to be 1 to 10, 12-17 or 1 to 17...
Any way to dynamically change the classBreakInfovalues?
0 Kudos
JenniferNery
Esri Regular Contributor
How about creating your own Renderer that implements IRenderer?
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.IRenderer_...

In the GetSymbol() you can perform the check on attribute and decide the symbol dynamically.
0 Kudos