<?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 to set active layout in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783310#M1195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jeff!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2019 12:39:52 GMT</pubDate>
    <dc:creator>WuYao</dc:creator>
    <dc:date>2019-05-28T12:39:52Z</dc:date>
    <item>
      <title>how to set active layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783308#M1193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a list of layouts and want to be able to set one of them as the active view in Pro SDK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2019 14:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783308#M1193</guid>
      <dc:creator>WuYao</dc:creator>
      <dc:date>2019-05-24T14:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to set active layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783309#M1194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check out Layout snippets 2-4:&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Layouts"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Layouts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code snippet of mine that looks for all possibilities (examples above combined):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Check to see if the layout already exists&lt;BR /&gt; LayoutProjectItem layoutItem = Project.Current.GetItems&amp;lt;LayoutProjectItem&amp;gt;().FirstOrDefault(item =&amp;gt; item.Name.Equals("Game Board"));&lt;BR /&gt; if (layoutItem != null)&lt;BR /&gt; {&lt;BR /&gt; Layout lyt = await QueuedTask.Run(() =&amp;gt; layoutItem.GetLayout());&lt;BR /&gt; &lt;BR /&gt; //Next check to see if a layout view is already open that referencs the Game Board layout&lt;BR /&gt; foreach (var pane in ProApp.Panes)&lt;BR /&gt; {&lt;BR /&gt; var lytPane = pane as ILayoutPane;&lt;BR /&gt; if (lytPane == null) //if not a layout view, continue to the next pane&lt;BR /&gt; continue;&lt;BR /&gt; if (lytPane.LayoutView.Layout == lyt) //if there is a match, activate the view&lt;BR /&gt; {&lt;BR /&gt; (lytPane as Pane).Activate();&lt;BR /&gt; System.Windows.MessageBox.Show("Activating existing pane");&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//If panes don't exist, then open a new pane&lt;BR /&gt; await ProApp.Panes.CreateLayoutPaneAsync(lyt);&lt;BR /&gt; System.Windows.MessageBox.Show("Opening already existing layout");&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//The layout does not exist so create a new one&lt;BR /&gt; Layout layout = await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run&amp;lt;Layout&amp;gt;(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; //*** CREATE A NEW LAYOUT ***&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2019 21:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783309#M1194</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2019-05-24T21:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to set active layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783310#M1195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jeff!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 12:39:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-active-layout/m-p/783310#M1195</guid>
      <dc:creator>WuYao</dc:creator>
      <dc:date>2019-05-28T12:39:52Z</dc:date>
    </item>
  </channel>
</rss>

