<?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 Hide/Close dock pane when creating or moving to new project from an existing one in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323792#M10259</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It seems dock pane is sticky and seems to remain opened after opening it once. It will remain still open when creating a new project when an existing project is opened (so basically when moved from opened to a new project).&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my use case my dock pane will be opened when certain feature layers are added to the map. If not then the dock pane button will be disabled using state/condition. So for example I have created a project for the first time and added all the required layers to the map which will enable the button to open the dock pane. But now if I will create or move from that project and create a new one which will definitely not having the required layers. As per the implementation the button is disabled. But the problem is the dock pane is already opened besides the usual dock panes like Attributes, Catalog etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to check my condition and then try to hide the dock pane but it is still there.&lt;/P&gt;&lt;P&gt;FrameworkApplication.DockPaneManager.Find("MyDockpaneId")?.Hide();&lt;/P&gt;&lt;P&gt;What is the best way to hide or close the dock pane in this use case?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2023 08:23:26 GMT</pubDate>
    <dc:creator>GISNewbieDev</dc:creator>
    <dc:date>2023-08-30T08:23:26Z</dc:date>
    <item>
      <title>Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323792#M10259</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It seems dock pane is sticky and seems to remain opened after opening it once. It will remain still open when creating a new project when an existing project is opened (so basically when moved from opened to a new project).&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my use case my dock pane will be opened when certain feature layers are added to the map. If not then the dock pane button will be disabled using state/condition. So for example I have created a project for the first time and added all the required layers to the map which will enable the button to open the dock pane. But now if I will create or move from that project and create a new one which will definitely not having the required layers. As per the implementation the button is disabled. But the problem is the dock pane is already opened besides the usual dock panes like Attributes, Catalog etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to check my condition and then try to hide the dock pane but it is still there.&lt;/P&gt;&lt;P&gt;FrameworkApplication.DockPaneManager.Find("MyDockpaneId")?.Hide();&lt;/P&gt;&lt;P&gt;What is the best way to hide or close the dock pane in this use case?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 08:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323792#M10259</guid>
      <dc:creator>GISNewbieDev</dc:creator>
      <dc:date>2023-08-30T08:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323814#M10260</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to catch project closing event in dock pane code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        /// &amp;lt;summary&amp;gt;
        /// Override to implement custom initialization code for this dockpane
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            ProjectClosingEvent.Subscribe(OnProjectClosing);
        }&lt;/LI-CODE&gt;&lt;P&gt;And on project closing execute code below:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        private Task OnProjectClosing(ProjectClosingEventArgs args)
        {
            // if already cancelled, ignore
            if (args.Cancel)
                return Task.CompletedTask;

            var vm = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
            if (vm != null) vm.Hide();

            return Task.CompletedTask;
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Aug 2023 10:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323814#M10260</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-08-30T10:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323816#M10261</link>
      <description>&lt;P&gt;But in the project closing I will not know whether the project we are opening contains the required layers in the active map since that will be the condition to hide the dock pane. If we are creating a new project in that case it will work since we know there will be no layers. But if we are opening the existing project then this will not work. And also I will know whether the project contains the required layers after the map is initialized since that logic to know is written in&amp;nbsp;ActiveMapViewChangedEvent. Since project related event will be triggered before&amp;nbsp;ActiveMapViewChangedEvent therefore also at the time of project related event is triggered I will not have that info to know which are layers are in the map.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 10:07:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323816#M10261</guid>
      <dc:creator>GISNewbieDev</dc:creator>
      <dc:date>2023-08-30T10:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323840#M10263</link>
      <description>&lt;P&gt;I catch project open event In addin module.&lt;/P&gt;&lt;P&gt;In project opening event handler I initiate&amp;nbsp;DrawCompleteEvent catching&lt;/P&gt;&lt;P&gt;In&amp;nbsp;DrawCompleteEvent handler I stop&amp;nbsp;DrawCompleteEvent catching and reload layers from toc where I need.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 11:17:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1323840#M10263</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-08-30T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1324186#M10275</link>
      <description>&lt;P&gt;I couldnt understood&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 00:33:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1324186#M10275</guid>
      <dc:creator>GISNewbieDev</dc:creator>
      <dc:date>2023-08-31T00:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Close dock pane when creating or moving to new project from an existing one</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1324273#M10276</link>
      <description>&lt;P&gt;I wrote how to get info&amp;nbsp;&lt;SPAN&gt;which layers are in the map when project loads&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 09:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/hide-close-dock-pane-when-creating-or-moving-to/m-p/1324273#M10276</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-08-31T09:25:15Z</dc:date>
    </item>
  </channel>
</rss>

