<?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: Adding MapTip in code-behind in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327755#M8419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Dominique, that solved the problem. Alot less code to maintain now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I forgot another cruicial thing though, assigning the MapTip to the symbol (g.MapTip = mapTip).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to loop through all of my MapTips and keep them visible indefinitely? The reason I want to implement this is because when we want to print the maps, we won't have any visible notes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;To make things clearer, I'd like to click on the symbol I placed and that will launch a function that sets the HideDelay of the MapTip to infinity, through code-behind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johan Carlsson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2012 12:18:05 GMT</pubDate>
    <dc:creator>JohanCarlsson</dc:creator>
    <dc:date>2012-09-21T12:18:05Z</dc:date>
    <item>
      <title>Adding MapTip in code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327752#M8416</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'm new to programming with this API and I'm trying to add MapTip's dynamically where the user clicks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do everything in the code-behind since I'm working with the viewer and can't initialize any new maps in the XAML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's what I got so far, code is executed in the order below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Creating the layer:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;GraphicsLayer mapTipLayer = new GraphicsLayer();&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; mapTipLayer.ID = "mapTipLayer"; MapApplication.Current.Map.Layers.Add(mapTipLayer); MapApplication.SetLayerName(mapTipLayer, "MapTip Layer");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Setting a DefaultSymbol where the user clicks:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGIS.Client.Graphic g = new ESRI.ArcGIS.Client.Graphic() { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry = mapPoint, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Symbol = LayoutRoot.Resources["DefaultMapTipSymbol"] as Symbol, }; mapTipLayer.Graphics.Add(g);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything works fine so far, the problems start when I try to use the MapTip-class. The graphic I addshows up but there's no hover function that displays anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGIS.Client.Toolkit.MapTip mapTip = new ESRI.ArcGIS.Client.Toolkit.MapTip(); mapTip.GraphicsLayer = mapTipLayer; mapTip.Title = "Some content"; mapTipLayer.MapTip = mapTip;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing it in the wrong order? Am I missing something? If I understood the API reference correctly this should be enough to display a MapTip. Should I add all MapTips &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;before&lt;/SPAN&gt;&lt;SPAN&gt; I add the layer to the current map? Should I use a FeatureLayer instead?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've also tried this instead for the first code block:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mapTipLayer = new GraphicsLayer();&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; mapTipLayer.ID = "mapTipLayer"; mapTipLayer.MapTip = new ESRI.ArcGIS.Client.Toolkit.MapTip() { Title = "test" }; MapApplication.Current.Map.Layers.Add(mapTipLayer); MapApplication.SetLayerName(mapTipLayer, "MapTip Layer");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions, tips or references to similiar problems would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johan Carlsson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 07:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327752#M8416</guid>
      <dc:creator>JohanCarlsson</dc:creator>
      <dc:date>2012-09-19T07:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapTip in code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327753#M8417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I scrapped this approach, it was too troublesome. In a fraction of the time I implemented a simple MouseEnter and MouseLeave to create something similar to a MapTip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 07:49:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327753#M8417</guid>
      <dc:creator>JohanCarlsson</dc:creator>
      <dc:date>2012-09-20T07:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapTip in code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327754#M8418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ESRI.ArcGIS.Client.Toolkit.MapTip mapTip = new ESRI.ArcGIS.Client.Toolkit.MapTip();&lt;BR /&gt;mapTip.GraphicsLayer = mapTipLayer;&lt;BR /&gt;mapTip.Title = "Some content";&lt;BR /&gt;mapTipLayer.MapTip = mapTip;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get maptips, you can either use the maptip control or set the maptip property of the layer. But don't do both.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Removing the latest line of your code shoudl work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;PRE&gt;ESRI.ArcGIS.Client.Toolkit.MapTip mapTip = new ESRI.ArcGIS.Client.Toolkit.MapTip();&lt;/PRE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mapTip.GraphicsLayer = mapTipLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mapTip.Title = "Some content";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#ff0000;"&gt;///mapTipLayer.MapTip = mapTip;[/&lt;/SPAN&gt;&lt;SPAN&gt;CODE]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 14:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327754#M8418</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-09-20T14:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding MapTip in code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327755#M8419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Dominique, that solved the problem. Alot less code to maintain now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I forgot another cruicial thing though, assigning the MapTip to the symbol (g.MapTip = mapTip).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to loop through all of my MapTips and keep them visible indefinitely? The reason I want to implement this is because when we want to print the maps, we won't have any visible notes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;To make things clearer, I'd like to click on the symbol I placed and that will launch a function that sets the HideDelay of the MapTip to infinity, through code-behind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johan Carlsson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2012 12:18:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/adding-maptip-in-code-behind/m-p/327755#M8419</guid>
      <dc:creator>JohanCarlsson</dc:creator>
      <dc:date>2012-09-21T12:18:05Z</dc:date>
    </item>
  </channel>
</rss>

