<?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 Is it possible to use a DataTemplate for Symbol? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42276#M1118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have ControlTemplate working, but I want to be able to bind to a DataTemplate so that I can get model-data instead of just static UI. So that when I hover the mouse over a graphic(say a Vehicle), that I can retrieve Vehicle info to display through the template(i.e., pop up). I can't do this with ControlTemplate as it has no DataContext.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Oct 2010 20:47:33 GMT</pubDate>
    <dc:creator>AlexAgranov</dc:creator>
    <dc:date>2010-10-08T20:47:33Z</dc:date>
    <item>
      <title>Is it possible to use a DataTemplate for Symbol?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42276#M1118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have ControlTemplate working, but I want to be able to bind to a DataTemplate so that I can get model-data instead of just static UI. So that when I hover the mouse over a graphic(say a Vehicle), that I can retrieve Vehicle info to display through the template(i.e., pop up). I can't do this with ControlTemplate as it has no DataContext.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 20:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42276#M1118</guid>
      <dc:creator>AlexAgranov</dc:creator>
      <dc:date>2010-10-08T20:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a DataTemplate for Symbol?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42277#M1119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The DataTemplate doesn't have a DataContext either. It's the element that the template gets applied to that has a DataContext. So in other words: Yes you can do this with ControlTemplate too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can bind to attributes and symbol properties like so (assuming a FontSize property on the symbol class and a "Title" attribute in the graphic):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ControlTemplate&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock FontSize="{Binding Symbol.FontSize}" Text="{Binding Attributes[Title]}" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ControlTemplate&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 20:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42277#M1119</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-10-08T20:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a DataTemplate for Symbol?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42278#M1120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The DataTemplate doesn't have a DataContext either. It's the element that the template gets applied to that has a DataContext. So in other words: Yes you can do this with ControlTemplate too.&lt;BR /&gt; &lt;BR /&gt;You can bind to attributes and symbol properties like so (assuming a FontSize property on the symbol class and a "Title" attribute in the graphic):&lt;BR /&gt; &lt;BR /&gt;&amp;lt;ControlTemplate&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock FontSize="{Binding Symbol.FontSize}" Text="{Binding Attributes[Title]}" /&amp;gt;&lt;BR /&gt;&amp;lt;/ControlTemplate&amp;gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, I just wasn't clear on templates to begin with. But how would I assign the DataContext to a Graphic? It's not a FrameworkElement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok - I finally got it. The DataContext is Graphic.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 20:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/is-it-possible-to-use-a-datatemplate-for-symbol/m-p/42278#M1120</guid>
      <dc:creator>AlexAgranov</dc:creator>
      <dc:date>2010-10-08T20:59:48Z</dc:date>
    </item>
  </channel>
</rss>

