<?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 Changing Panes after CreateMapPaneAsync() in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846316#M4095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a new Map pane (with a new map in it) but keep the current layout pane I am on active.&amp;nbsp; When I run these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string mapName = $"{Name} Map";&lt;BR /&gt; Map newMap = await QueuedTask.Run(() =&amp;gt; MapFactory.Instance.CreateMap(mapName));&lt;BR /&gt; Pane layoutPane = ProApp.Panes.ActivePane;&lt;BR /&gt; await ProApp.Panes.CreateMapPaneAsync(newMap);&lt;BR /&gt; layoutPane.Activate();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the new pane get created and start initializing, then the layout is selected, then the new pane is re-selected (presumably when it finishes initializing).&amp;nbsp; What do I need to do to come out of this code with the layout as my active pane?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 17:41:55 GMT</pubDate>
    <dc:creator>JeffBoyton</dc:creator>
    <dc:date>2020-03-30T17:41:55Z</dc:date>
    <item>
      <title>Changing Panes after CreateMapPaneAsync()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846316#M4095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a new Map pane (with a new map in it) but keep the current layout pane I am on active.&amp;nbsp; When I run these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string mapName = $"{Name} Map";&lt;BR /&gt; Map newMap = await QueuedTask.Run(() =&amp;gt; MapFactory.Instance.CreateMap(mapName));&lt;BR /&gt; Pane layoutPane = ProApp.Panes.ActivePane;&lt;BR /&gt; await ProApp.Panes.CreateMapPaneAsync(newMap);&lt;BR /&gt; layoutPane.Activate();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the new pane get created and start initializing, then the layout is selected, then the new pane is re-selected (presumably when it finishes initializing).&amp;nbsp; What do I need to do to come out of this code with the layout as my active pane?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 17:41:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846316#M4095</guid>
      <dc:creator>JeffBoyton</dc:creator>
      <dc:date>2020-03-30T17:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Panes after CreateMapPaneAsync()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846317#M4096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff&lt;/P&gt;&lt;P&gt;CreateMapPaneAsync triggers other internal events in Pro that does the initialization and opening of the map pane routines.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way you could accomplish what you&amp;nbsp;need is by:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Subscribing to the &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic12634.html" rel="nofollow noopener noreferrer" target="_blank"&gt;DrawCompleteEvent&lt;/A&gt;. In the event handler, once your "Map" opens, activate the layout pane.&lt;/LI&gt;&lt;/UL&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//In your module class initialize call back&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;override&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Initialize&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Desktop&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Events&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DrawCompleteEvent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Subscribe&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;OnDrawComplete&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;base&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Initialize&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Remember to unsubscribe so that thsi happens only once (if that is the behavior you need)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnDrawComplete&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapViewEventArgs obj&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;obj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"New Map"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        Module1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;LayoutPane&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Activate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&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>Sun, 12 Dec 2021 10:23:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846317#M4096</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-12-12T10:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Panes after CreateMapPaneAsync()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846318#M4097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked great.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 16:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-panes-after-createmappaneasync/m-p/846318#M4097</guid>
      <dc:creator>JeffBoyton</dc:creator>
      <dc:date>2020-03-31T16:50:03Z</dc:date>
    </item>
  </channel>
</rss>

