<?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: Drag item from custom DockPane and Drop on a Map in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814572#M2494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;Didn't get the&amp;nbsp;IMappableItem option to run (no sample found), but the following sample shows another option to achieve the same result (point 11. - drag from TreeView and drop to Map):&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/DragAndDrop#how-to-use-the-sample" title="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/DragAndDrop#how-to-use-the-sample"&gt;arcgis-pro-sdk-community-samples/Framework/DragAndDrop at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Populating the ItemInfoValue object with the Item information provided by ItemFactory.Instance.Create() makes the cursor receive the 'droppable' effect when over a Map or Scene.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Feb 2020 16:13:05 GMT</pubDate>
    <dc:creator>JaneDoe</dc:creator>
    <dc:date>2020-02-11T16:13:05Z</dc:date>
    <item>
      <title>Drag item from custom DockPane and Drop on a Map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814570#M2492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Can anyone provide a sample on how to handle the Drop event of a custom item (not a file) on a Map or Scene?&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;Drag&lt;/STRONG&gt; operation is initiated on the TreeView of a custom DockPane as specified in &lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#drag-support" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#drag-support" rel="nofollow noopener noreferrer" target="_blank"&gt;ProConcepts Framework · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt; and seems to work just fine. That is, StartDrag() is called on dragging a TreeViewItem and the cursor receives the 'not droppable' effect, which is probably ok since the Drop target has not yet been defined.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public void StartDrag(DragInfo dragInfo)
{
    dragInfo.Data = "SELECTED LAYER...";
    dragInfo.Effects = DragDropEffects.Move;
}&lt;/PRE&gt;&lt;P&gt;Custom &lt;STRONG&gt;Drop&lt;/STRONG&gt; handlers &lt;STRONG&gt;for files&lt;/STRONG&gt; (with the specified extensions) can be defined in DAML (&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#custom-drop-handlers-in-daml" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#custom-drop-handlers-in-daml" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#custom-drop-handlers-in-daml&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;&lt;SPAN class=""&gt;insertHandler&lt;/SPAN&gt; &lt;SPAN class=""&gt;id&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"DragDropExample_ExcelDropHandler"&lt;/SPAN&gt; &lt;SPAN class=""&gt;className&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"ExcelDropHandler"&lt;/SPAN&gt; &lt;SPAN class=""&gt;dataTypes&lt;/SPAN&gt;=&lt;SPAN class=""&gt;".XLSX|.xlsx|.XLS|.xls"&lt;/SPAN&gt; /&amp;gt;&lt;/PRE&gt;&lt;P&gt;I couldn't find a way though to employ them for the &lt;STRONG&gt;Drop of a custom item&lt;/STRONG&gt;. Is there another way to make the Map a Drop target for my TreeViewItem?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814570#M2492</guid>
      <dc:creator>JaneDoe</dc:creator>
      <dc:date>2021-12-12T16:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Drag item from custom DockPane and Drop on a Map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814571#M2493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monika&lt;/P&gt;&lt;P&gt;To drag and drop a custom item, implement the &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic26340.html"&gt;IMappableItem interface&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to implement the following 2 methods on your custom item:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic26345.html"&gt;CanAddToMap Method&lt;/A&gt;: Return true here to allow the items to be dropped on a Map or Scene.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic26346.html"&gt;OnAddToMap method:&lt;/A&gt;&amp;nbsp;This is where you add your logic that allows you to display your item in the map. It could be where you load your plugin, or run a GP tool, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Custom item guide and samples will be updated with this info when Pro 2.5 is released next week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 18:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814571#M2493</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2020-01-28T18:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Drag item from custom DockPane and Drop on a Map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814572#M2494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;Didn't get the&amp;nbsp;IMappableItem option to run (no sample found), but the following sample shows another option to achieve the same result (point 11. - drag from TreeView and drop to Map):&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/DragAndDrop#how-to-use-the-sample" title="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/DragAndDrop#how-to-use-the-sample"&gt;arcgis-pro-sdk-community-samples/Framework/DragAndDrop at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Populating the ItemInfoValue object with the Item information provided by ItemFactory.Instance.Create() makes the cursor receive the 'droppable' effect when over a Map or Scene.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/drag-item-from-custom-dockpane-and-drop-on-a-map/m-p/814572#M2494</guid>
      <dc:creator>JaneDoe</dc:creator>
      <dc:date>2020-02-11T16:13:05Z</dc:date>
    </item>
  </channel>
</rss>

