<?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: Binding to a maptip value in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759638#M19378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;DOH! That worked! Thank you, I'm actually doing something very similar in another portion of my project, totally forgot. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again Dominique!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Mar 2014 14:26:54 GMT</pubDate>
    <dc:creator>gabrielvazquez</dc:creator>
    <dc:date>2014-03-21T14:26:54Z</dc:date>
    <item>
      <title>Binding to a maptip value</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759636#M19376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm attempting to bind a string in behind code to a textblock value in a maptip. Not sure if there was a specific way to do this, but I cant seem to get it to work. I'm attempting to run a spatial query using geometry from a chosen graphic in a feature layer similar to this thread:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/48259-Select-FeatureLayer-graphic-based-on-DataGrid-click" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/48259-Select-FeatureLayer-graphic-based-on-DataGrid-click&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The feature layer in the XAML has a maptip textblock which is binding to the feature layer "Name" field. I also placed a button in the maptip, once the user clicks on the button, it should run a query using the textblock.text to find the correct graphic, then assign that graphic.geometry to an additional spatial search. However, I cant seem to grab the maptip.textblock value from behind the code. When I attempt to grab the textblock.text in Code it comes up null. Not if this is because i'm simply binding the text value to the featurelayer on the fly, or why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is some of my code, if anyone has any recommendations please let me know.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the XAML for the featurelayer, i left out some of the unimportant code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;esri:FeatureLayer ID:"EllipseLayer" Url"http//...." OutFields="*"&amp;gt;
&amp;lt;esri:Featurelayer.MapTip&amp;gt;
&amp;lt;TextBlock x:Name="EllipseLayerName" Text="{Binding [Name]}" /&amp;gt;
&amp;lt;Button x:Name="GetEllipseNameBtn" Click="GetEllipseNameBtn_Click"/&amp;gt;
&amp;lt;/esri:Featurelayer.MapTip&amp;gt;
&amp;lt;/esri:FeatureLayer /&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the C# Code for when the Button is clicked&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
FeatureLayer fl = Map.Layers["EllipseLayer"] as FeatureLayer;

Graphic gl = fl.Graphics.Where(g =&amp;gt; g.Attributes["Name"].ToString() == EllipseLayerName.Text).First();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if I need to reference the EllipseLayerName in the maptip differently but it continues to come up null. When I create a temporary string and use that string with a defined value the query works fine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:16:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759636#M19376</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2021-12-12T08:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Binding to a maptip value</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759637#M19377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The maptip is not in the same namespace as the main window so you can't use the element name this way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead use the datacontext which is set with the dictionary of attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var button = sender as Button;
var attributes = button.DataContext as IDictionary&amp;lt;string, object&amp;gt;;
var currentName = attributes["Name"].ToString();
....&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:16:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759637#M19377</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-12T08:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Binding to a maptip value</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759638#M19378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;DOH! That worked! Thank you, I'm actually doing something very similar in another portion of my project, totally forgot. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again Dominique!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 14:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-a-maptip-value/m-p/759638#M19378</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2014-03-21T14:26:54Z</dc:date>
    </item>
  </channel>
</rss>

