<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Retrieve text from TextSymbol in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/retrieve-text-from-textsymbol/m-p/492250#M12627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a snippet that saves/opens graphics within a project, writing to a CSV.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a TextSymbol in my map and would like to save these markup graphics that contain text/labels to the CSV as well, but I'm having a hard time retrieving the text of the TextSymbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;GraphicCollection pGC = graphicsLayer.Graphics;
foreach (Graphic g in pGc)
{
if (g.Geometry is ESRI.ArcGIS.Client.Symbols.TextSymbol)
{
MapPoint pPoint = (MapPoint)g.Geometry;
pStreamWriter.WriteLine("TEST, " + pPoint.X.ToString() + ", " + pPoint.Y.ToString());
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the WriteLine, I would like to add the text of the TextSymbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Mar 2011 14:35:03 GMT</pubDate>
    <dc:creator>ErikEngstrom</dc:creator>
    <dc:date>2011-03-21T14:35:03Z</dc:date>
    <item>
      <title>Retrieve text from TextSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/retrieve-text-from-textsymbol/m-p/492250#M12627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a snippet that saves/opens graphics within a project, writing to a CSV.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a TextSymbol in my map and would like to save these markup graphics that contain text/labels to the CSV as well, but I'm having a hard time retrieving the text of the TextSymbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;GraphicCollection pGC = graphicsLayer.Graphics;
foreach (Graphic g in pGc)
{
if (g.Geometry is ESRI.ArcGIS.Client.Symbols.TextSymbol)
{
MapPoint pPoint = (MapPoint)g.Geometry;
pStreamWriter.WriteLine("TEST, " + pPoint.X.ToString() + ", " + pPoint.Y.ToString());
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the WriteLine, I would like to add the text of the TextSymbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 14:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/retrieve-text-from-textsymbol/m-p/492250#M12627</guid>
      <dc:creator>ErikEngstrom</dc:creator>
      <dc:date>2011-03-21T14:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve text from TextSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/retrieve-text-from-textsymbol/m-p/492251#M12628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the Text of your TextSymbol is set to one of your graphic attributes, you can simply get the attribute value. Otherwise, you can cast the Symbol to TextSymbol to get Text property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void GraphicsLayer_Initialized(object sender, System.EventArgs e)
{
 GraphicsLayer layer = sender as GraphicsLayer;
 foreach (var g in layer.Graphics)
 {
&amp;nbsp; g.Attributes["Location"] = g.Geometry;
&amp;nbsp; g.Symbol = new TextSymbol() { Text = g.Attributes["Location"].ToString()};
&amp;nbsp; //System.Diagnostics.Debug.WriteLine(g.Attributes["Location"]); //from attribute
&amp;nbsp; System.Diagnostics.Debug.WriteLine((g.Symbol as TextSymbol).Text); //as TextSymbol
 }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:39:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/retrieve-text-from-textsymbol/m-p/492251#M12628</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T21:39:33Z</dc:date>
    </item>
  </channel>
</rss>

