<?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 Bug with Visuals on map? in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258059#M1218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to do provide some in-place editing in some of our custom symbols. So I have to put a textbox inside the symbol templates. Doing so results in crashes in some ArcGis APIs. I tracked down at least one bug:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;GraphicsLayer.FindGraphicsInHostCoordinates(Rect)&lt;/STRONG&gt;&lt;SPAN&gt; is buggy if the intersectingRect contains the textbox. Here???s why. It first uses &lt;/SPAN&gt;&lt;STRONG&gt;VisualTreeHelper.HitTest&lt;/STRONG&gt;&lt;SPAN&gt; to find the visuals inside the rectangle, but then casts them to UIElement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;elements.Add(result.VisualHit as UIElement)&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem with that line is that some Visuals are not UIElement, e.g. when using textboxes. Because of that a null is inserted inside the result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step is calling the private &lt;/SPAN&gt;&lt;STRONG&gt;GetGraphicsFromUIElements()&lt;/STRONG&gt;&lt;SPAN&gt; method, which doesn???t handle nulls and crashes with a NullReferenceException.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect that &lt;/SPAN&gt;&lt;STRONG&gt;GraphicsLayer.FindGraphicsInHostCoordinates(Point)&lt;/STRONG&gt;&lt;SPAN&gt; would crash as well since it tries to perform a direct cast:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;(UIElement)hitTestResult.VisualHit&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;which would surely result in an InvalidCastException.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2011 08:41:02 GMT</pubDate>
    <dc:creator>GéraldReusser</dc:creator>
    <dc:date>2011-10-18T08:41:02Z</dc:date>
    <item>
      <title>Bug with Visuals on map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258059#M1218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to do provide some in-place editing in some of our custom symbols. So I have to put a textbox inside the symbol templates. Doing so results in crashes in some ArcGis APIs. I tracked down at least one bug:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;GraphicsLayer.FindGraphicsInHostCoordinates(Rect)&lt;/STRONG&gt;&lt;SPAN&gt; is buggy if the intersectingRect contains the textbox. Here???s why. It first uses &lt;/SPAN&gt;&lt;STRONG&gt;VisualTreeHelper.HitTest&lt;/STRONG&gt;&lt;SPAN&gt; to find the visuals inside the rectangle, but then casts them to UIElement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;elements.Add(result.VisualHit as UIElement)&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem with that line is that some Visuals are not UIElement, e.g. when using textboxes. Because of that a null is inserted inside the result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step is calling the private &lt;/SPAN&gt;&lt;STRONG&gt;GetGraphicsFromUIElements()&lt;/STRONG&gt;&lt;SPAN&gt; method, which doesn???t handle nulls and crashes with a NullReferenceException.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect that &lt;/SPAN&gt;&lt;STRONG&gt;GraphicsLayer.FindGraphicsInHostCoordinates(Point)&lt;/STRONG&gt;&lt;SPAN&gt; would crash as well since it tries to perform a direct cast:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;(UIElement)hitTestResult.VisualHit&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;which would surely result in an InvalidCastException.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 08:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258059#M1218</guid>
      <dc:creator>GéraldReusser</dc:creator>
      <dc:date>2011-10-18T08:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with Visuals on map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258060#M1219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to reproduce the issue. Thank you for reporting this to us. We will try to get it fixed in future releases of the API.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 18:55:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258060#M1219</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-10-19T18:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with Visuals on map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258061#M1220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Jennifer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you tell me if the fix will be included in the next release (coming soon I think)? Since some of our features depend on it, we would like to know what will be possible in the short term.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 08:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258061#M1220</guid>
      <dc:creator>GéraldReusser</dc:creator>
      <dc:date>2011-10-20T08:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with Visuals on map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258062#M1221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem. Your detailed description helped a lot. Yes, it is targeted for v2.3 Final.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 13:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/bug-with-visuals-on-map/m-p/258062#M1221</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-10-20T13:54:10Z</dc:date>
    </item>
  </channel>
</rss>

