<?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: How do you instantiate dockpane programattically? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-instantiate-dockpane-programattically/m-p/1048037#M6452</link>
    <description>&lt;P&gt;&lt;SPAN&gt;For everyone coming here at a later point:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I had a similar problem, where a built-in dockpane wasn’t being instantiated with the DockPaneManager.Find(…) method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;For me the solution was to find and activate the built-in Dockpane on the UI thread like so:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Application.Current.Dispatcher.Invoke(() =&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var dockPane = FrameworkApplication.DockPaneManager.Find("esri_editing_CreateFeaturesDockPane");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;dockPane.Activate();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 11:28:25 GMT</pubDate>
    <dc:creator>Mira</dc:creator>
    <dc:date>2021-04-16T11:28:25Z</dc:date>
    <item>
      <title>How do you instantiate dockpane programattically?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-instantiate-dockpane-programattically/m-p/739137#M215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an add-in with a button and a couple of mapTools in a group, as well as a dockpane (The buttons are not in the dockpane).&amp;nbsp;When the button is pressed it runs a GPService, and when that service finishes, the results are displayed in the dockpane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now, this is working, &lt;EM&gt;but only if you manually open the dockpane before running the tool (by clicking the ShowButton).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the dockpane is not opened manually then&amp;nbsp;FrameworkApplication.DockPaneManager.Find() returns null since the dockframe instance has not been created..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried calling the Show() method on the viewmodel (since this gets called when you click the button), however this does not seem to actually create the dockpane instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also using the&amp;nbsp;FrameworkApplication.DockPaneManager.IsDockPaneCreated() method, but it explicitly says that&amp;nbsp; "This function will not create the dock pane if it does not exist."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't find anywhere where it says how to create this instance. I see in the documentation where it says:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Dock panes are singletons: there is never more than one instance of a particular dock pane and once created, they are not destroyed until the application shuts down. Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/topic10118.html" style="color: #1364c4; text-decoration: none;"&gt;Find&lt;/A&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to access a specific dock pane.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So how can you actually create that instance if it does not exist?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2020 20:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-instantiate-dockpane-programattically/m-p/739137#M215</guid>
      <dc:creator>JamesGough</dc:creator>
      <dc:date>2020-04-16T20:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you instantiate dockpane programattically?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-instantiate-dockpane-programattically/m-p/1048037#M6452</link>
      <description>&lt;P&gt;&lt;SPAN&gt;For everyone coming here at a later point:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I had a similar problem, where a built-in dockpane wasn’t being instantiated with the DockPaneManager.Find(…) method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;For me the solution was to find and activate the built-in Dockpane on the UI thread like so:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Application.Current.Dispatcher.Invoke(() =&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var dockPane = FrameworkApplication.DockPaneManager.Find("esri_editing_CreateFeaturesDockPane");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;dockPane.Activate();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-instantiate-dockpane-programattically/m-p/1048037#M6452</guid>
      <dc:creator>Mira</dc:creator>
      <dc:date>2021-04-16T11:28:25Z</dc:date>
    </item>
  </channel>
</rss>

