<?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: MapTips via Code-Behind in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81219#M1977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;MapTip can't be defined as resource (even in XAML).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But you can define it by code the same way than in XAML : ObjectsGraphicsLayer.MapTip = new Border() { ......&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Sep 2010 10:06:30 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2010-09-01T10:06:30Z</dc:date>
    <item>
      <title>MapTips via Code-Behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81218#M1976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is there any possibility to add MapTips to a GraphicsLayer via Code-Behind?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code like the following ends with an ArgumentException when I hover over a MarkerSymbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var mapTip = (FrameworkElement)ESRIMap.Resources["ESRIMapTip"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ObjectsGraphicsLayer.MapTip = mapTip;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For test purposes I use no binding in the MapTip XAML. It's just a plain border.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Benjamin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 08:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81218#M1976</guid>
      <dc:creator>AlexanderBlock</dc:creator>
      <dc:date>2010-09-01T08:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: MapTips via Code-Behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81219#M1977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;MapTip can't be defined as resource (even in XAML).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But you can define it by code the same way than in XAML : ObjectsGraphicsLayer.MapTip = new Border() { ......&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 10:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81219#M1977</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2010-09-01T10:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: MapTips via Code-Behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81220#M1978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would create a custom usercontrol that contains everything you want in the maptip (including borders etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then programmatically you simply set:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MyGraphicsLayer.MapTip = new MyMapTipUserControl();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can still do all the binding stuff in this user control as you normally would when defining it straight in the Xaml.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 15:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81220#M1978</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-09-01T15:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: MapTips via Code-Behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81221#M1979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also like to define map tips from code-behind.&amp;nbsp; I need to setup map tips for several layers each with a different list of fields to display. As Morton says, maybe a custom user control would do to define the look, but how do I pass it the fields I want to show?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2011 16:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81221#M1979</guid>
      <dc:creator>PaulHuppé</dc:creator>
      <dc:date>2011-05-13T16:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: MapTips via Code-Behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81222#M1980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In you custom control you can generate the fields based on the Keys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if add a Dependency Property to the UserControl and do the binding to that ie &amp;lt;local:MyMapTipControl Data="{Binding} /&amp;gt;. In the DependencyPropertyChanged event handler, in the grid you have that contains the fields clear its children and its row definitions , and do a simple foreach on the keys/values to generate some new matching textblocks:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ie&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
int i=0;
foreach(var key in Data.Keys)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ContainerGrid.Rows.Add(new RowDefinition());
&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBlock tb = new TextBlock() { Text = key };
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb.SetValue(Grid.Column, i++);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ContainerGrid.Children.Add(tb);
&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBlock tb2 = new TextBlock() { Text = value };
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb.SetValue(Grid.Column, i);
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb.SetValue(Grid.Row, 1); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ContainerGrid.Children.Add(tb2);
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:06:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maptips-via-code-behind/m-p/81222#M1980</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2021-12-10T23:06:31Z</dc:date>
    </item>
  </channel>
</rss>

