<?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 Re: Converter Question in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140382#M3513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You converter is using the main value as SiteID. So, you should get the site name if the source of your binding is the siteID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming that you declare MySiteNameConverter in the resources et that the property SiteID is giving the siteID, it should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
{Binding Path=SiteID, Converter={StaticResource MySiteNameConverter}}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:44:28 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2021-12-11T07:44:28Z</dc:date>
    <item>
      <title>Converter Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140381#M3512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to add a map tip to a feature layer.&amp;nbsp; The service that the layer is bound to returns a collection of sites, and one of the properties that the service brings back is the primary key, called Site_ID.&amp;nbsp; In the map tip, I want to display the name of the site, but the service doesn't return it, just Site_ID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't really have access to the service, so I can't just modify it to return the site name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My page contains a dictionary of side IDs/site names, so I'd like to write a converter at the page level that takes the Site_ID of the site as a parameter, and returns the site name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote this converter on the page...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class SiteNameConverter : IValueConverter
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // assume this dictionary is populated with site_id's, site_names.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Dictionary&amp;lt;String, String&amp;gt; siteDictionary = new Dictionary&amp;lt;string, string&amp;gt;();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return siteDictionary[value.ToString()];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotImplementedException("This method will not be called for one-way binding");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I just need to figure out how to pass it the Site_ID, to get back the site name.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 22:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140381#M3512</guid>
      <dc:creator>AaronEdwards</dc:creator>
      <dc:date>2010-10-08T22:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converter Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140382#M3513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You converter is using the main value as SiteID. So, you should get the site name if the source of your binding is the siteID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming that you declare MySiteNameConverter in the resources et that the property SiteID is giving the siteID, it should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
{Binding Path=SiteID, Converter={StaticResource MySiteNameConverter}}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140382#M3513</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T07:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converter Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140383#M3514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey, thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't actually work because the data context brought back from the map tip is an ESRI.ArcGIS.Client.Graphics.ObservableDictionary.&amp;nbsp; So Site_ID isn't a member.&amp;nbsp; We'd need to do something like...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding Converter={StaticResource siteNameConverter}, ConverterParameter={Binding [Site_ID]}}" /&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But of course you can't really do that: a binding within a binding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's frustrating, because the element above that is a simple textblock displaying the site ID as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding [Site_ID]}"&amp;nbsp; /&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I could just take that Site_ID somehow and feed it into the textblock above, then we'd have something.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:44:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140383#M3514</guid>
      <dc:creator>AaronEdwards</dc:creator>
      <dc:date>2021-12-11T07:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Converter Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140384#M3515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the SiteID is coming from a dictionary, the code should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
{Binding Path=[Site_ID], Converter={StaticResource MySiteNameConverter}}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140384#M3515</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T07:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converter Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140385#M3516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did it.&amp;nbsp; Thank you so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Oct 2010 18:03:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/converter-question/m-p/140385#M3516</guid>
      <dc:creator>AaronEdwards</dc:creator>
      <dc:date>2010-10-10T18:03:04Z</dc:date>
    </item>
  </channel>
</rss>

