<?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 Bind Symbol In MapTip? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324290#M8366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using a FeatureLayer that has different symbols coming from the server... Is there a way to bind the graphics corresponding symbol inside the map tip?&amp;nbsp; This way when using a clusterer (that hides the symbol) it would still show in the map tip!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sdl:MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Margin="10"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriPrimitives:SymbolDisplay Symbol="{Binding Symbol}" /&amp;gt; &amp;lt;!-- Trying to get symbol displayed here --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding [sgnl_type_desc]}" FontWeight="Bold" FontSize="12" Foreground="Black"&amp;nbsp; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding [ENTY_NME]}" FontSize="10" Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sdl:MapTip&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot for any help or ideas!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Sep 2011 16:22:07 GMT</pubDate>
    <dc:creator>RyanCoodey</dc:creator>
    <dc:date>2011-09-03T16:22:07Z</dc:date>
    <item>
      <title>Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324290#M8366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using a FeatureLayer that has different symbols coming from the server... Is there a way to bind the graphics corresponding symbol inside the map tip?&amp;nbsp; This way when using a clusterer (that hides the symbol) it would still show in the map tip!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sdl:MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Margin="10"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriPrimitives:SymbolDisplay Symbol="{Binding Symbol}" /&amp;gt; &amp;lt;!-- Trying to get symbol displayed here --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding [sgnl_type_desc]}" FontWeight="Bold" FontSize="12" Foreground="Black"&amp;nbsp; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding [ENTY_NME]}" FontSize="10" Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sdl:MapTip&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot for any help or ideas!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2011 16:22:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324290#M8366</guid>
      <dc:creator>RyanCoodey</dc:creator>
      <dc:date>2011-09-03T16:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324291#M8367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the feature service contains "drawingInfo" which defines the layer's Renderer, the graphic.Symbol property will be null. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also in the MapTip, the DataContext here is the graphic.Attributes, which is why the Binding statements use the square brackets '[]' to access the attribute key. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To show the Symbol, DataContext need to change to Graphic so you may access its Symbol property (which could be null when FeatureLayer.Renderer is used). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can probably use a Converter that will return a symbol based on graphic. If graphic.Symbol is not set and relies on renderer, you can get symbol from FeatureLayer.GetSymbol(graphic).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 18:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324291#M8367</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-09-06T18:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324292#M8368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jennifer,&amp;nbsp; Thanks a lot of the reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hmm, the FeatureLayer's service does contain a "drawingInfo", It has too right, to get the symbology from the server?&amp;nbsp; The FeatureLayer's Renderer is NOT null, but each graphic.Symbol is NOT null either...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please provide an example on how to set the DataContext to the Graphic (and not the Attributes collection)?&amp;nbsp; I have tried every binding I could think of but cannot get the graphic...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also made a value converter, if it is even needed, but not sure how to get access to the FeatureLayer in it to call FeatureLayer.GetSymbol(graphic)... but I will worry about that if the above doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you much and thanks for any more help!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 02:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324292#M8368</guid>
      <dc:creator>RyanCoodey</dc:creator>
      <dc:date>2011-09-07T02:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324293#M8369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FeatureLayer.LayerInfo.Renderer is the service-defined renderer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used this sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerMapTips" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerMapTips&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Added an AttributeToSymbolConverter class with DependencyProperty to get to the FeatureLayer.LayerInfo.Renderer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public class AttributeToSymbolConverter : FrameworkElement, IValueConverter
{
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
&amp;nbsp; var dict = value as IDictionary&amp;lt;string, object&amp;gt;;
&amp;nbsp; if (dict != null &amp;amp;&amp;amp; FeatureLayer != null &amp;amp;&amp;amp; FeatureLayer.LayerInfo != null &amp;amp;&amp;amp; FeatureLayer.LayerInfo.Renderer != null)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; var graphic = new Graphic();
&amp;nbsp;&amp;nbsp; foreach (var d in dict)
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes[d.Key] = d.Value;
&amp;nbsp;&amp;nbsp; return FeatureLayer.LayerInfo.Renderer.GetSymbol(graphic);
&amp;nbsp; }
&amp;nbsp; return null;
 }
&amp;nbsp; public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
&amp;nbsp; throw new NotImplementedException();
 }
&amp;nbsp; public static readonly DependencyProperty FeatureLayerProperty = DependencyProperty.Register("FeatureLayer", typeof(FeatureLayer),
&amp;nbsp; typeof(AttributeToSymbolConverter), null);

 public FeatureLayer FeatureLayer
 {
&amp;nbsp; get { return (FeatureLayer)GetValue(FeatureLayerProperty); }
&amp;nbsp; set { SetValue(FeatureLayerProperty, value); }
 }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;!--Grid.Resources--&amp;gt;
&amp;lt;local:AttributeToSymbolConverter x:Key="MyConverter" FeatureLayer="{Binding ElementName=MyMap, Path=Layers[CitiesFeatureLayer]}"/&amp;gt;
&amp;lt;!--FeatureLayer.MapTip.StackPanel--&amp;gt;
&amp;lt;esriPrimitives:SymbolDisplay Symbol="{Binding Converter={StaticResource MyConverter}}" /&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:23:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324293#M8369</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T15:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324294#M8370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot for that example, that is great... I didn't even think to pass the FeatureLayer that way.&amp;nbsp; I am still having issues with the binding though.&amp;nbsp; If I do the binding as in your example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;esriPrimitives:SymbolDisplay Symbol="{Binding Converter={StaticResource attributeToSymbolConverter}}" /&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does not bind to the attribute collection, but to the parent UserControl that hosts the ESRI map control... kind of wierd.&amp;nbsp; I also tried this binding&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;esriPrimitives:SymbolDisplay Symbol="{Binding /, Converter={StaticResource attributeToSymbolConverter}}" /&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And it seems to bind to the first item in the attribute collection, but not the collection itself...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll keep playing with the bindings, I'm still a bit new to SL/WPF... If you have any ideas though that would be great. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a ton for all the help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324294#M8370</guid>
      <dc:creator>RyanCoodey</dc:creator>
      <dc:date>2021-12-11T15:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324295#M8371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah that is strange. Element's DataContext inside FeatureLayer.MapTip should inherit its parent if it was not overwritten. The API sets this DataContext to the graphic.Attributes. Check that SymbolDisplay DataContext was not set or StackPanel/Grid that contained it did not have their DataContext set to something else. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you are not seeing a Symbol displayed? Does your OutFields include the type ID field or field used by your renderer? If it is SimpleRenderer, OutField does not need to contain any field but ClassBreaksRenderer or UniqueValueRenderer rely on fields and their values when determining symbol. Kindly try with the SDK sample first then tweak accordingly with your own service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 16:38:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324295#M8371</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-09-08T16:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bind Symbol In MapTip?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324296#M8372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The DataContext on a parent control was indeed set, I changed this around and it works great!&amp;nbsp; Thanks a lot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 14:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-symbol-in-maptip/m-p/324296#M8372</guid>
      <dc:creator>RyanCoodey</dc:creator>
      <dc:date>2011-09-09T14:03:33Z</dc:date>
    </item>
  </channel>
</rss>

