<?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: Reset properties when a dockpane closes in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1165555#M8040</link>
    <description>&lt;P&gt;Hi, thank you for your sample. It works and can distinguish when dock pane is closed and when its auto-hidden.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt;, it fails when the 'Auto-hide' (pin symbol) button is clicked. i.e. When the pane is opened, and auto-hide button is clicked, the message box shows 'x'. But it shouldn't?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 09:16:44 GMT</pubDate>
    <dc:creator>KarthikAditya</dc:creator>
    <dc:date>2022-04-19T09:16:44Z</dc:date>
    <item>
      <title>Reset properties when  a dockpane closes [edited: or close an Add-In]</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029542#M6233</link>
      <description>&lt;P&gt;I am trying to figure out:&lt;/P&gt;&lt;P&gt;a. How to reset the properties in the dockpane when it closes [edited: or close an Add-In]. The following code below with "SaveDirectory" is initialized when I open the dockpane for the first time, then even after closing it and opening several different projects, the value of "SaveDirectory" does not change. How do I do that?&lt;/P&gt;&lt;P&gt;b. I thought of resetting the value inside "UninitializeAsync()" method, but I guess "UninitializeAsync()" method is not used for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kenny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;namespace Test
{
    internal class TestDockPaneViewModel : DockPane
    {
        private string _saveDirectory;
        /// &amp;lt;summary&amp;gt;
        /// Default Directory to save all user input data.
        /// &amp;lt;/summary&amp;gt;		
        public string SaveDirectory
        {
            get { return _saveDirectory; }
            set { _saveDirectory = value; NotifyPropertyChanged(() =&amp;gt; SaveDirectory); }
        }        
        /// &amp;lt;summary&amp;gt;
        /// Constructor
        /// &amp;lt;/summary&amp;gt;
        protected TestDockPaneViewModel() 
        {
            SaveDirectory = System.IO.Directory.GetCurrentDirectory();
        }
        /// &amp;lt;summary&amp;gt;
        /// Called when the pane is uninitialized.
        /// &amp;lt;/summary&amp;gt;
        protected async override Task UninitializeAsync()
        {
		    // Reset Default Save Directory when dockpane closes // 
            SaveDirectory = null;
            await base.UninitializeAsync();
        }	
		 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:50:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029542#M6233</guid>
      <dc:creator>GyanendraGurung</dc:creator>
      <dc:date>2021-02-23T15:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029578#M6234</link>
      <description>&lt;P&gt;Did you try overriding &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic10421.html" target="_self"&gt;OnHidden&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029578#M6234</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-02-23T15:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029583#M6235</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What do you mean by "Dockpane closing"? By pressing x at the right upper corner you just hide dockpane.&lt;/P&gt;&lt;P&gt;So if it's right place for your reset code, so you can override OnShow Dockpane class method:&lt;/P&gt;&lt;P&gt;protected override void OnShow(bool isVisible)&lt;BR /&gt;{&lt;BR /&gt;if (!isVisible)&lt;BR /&gt;{&lt;BR /&gt;SaveDirectory = null;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;UninitializeAsync will be called on ArcGIS Pro closing.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029583#M6235</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2021-02-23T15:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029591#M6236</link>
      <description>&lt;P&gt;1. By&amp;nbsp;&lt;SPAN&gt;"Dockpane closing", I meant to close the Dockpane of the Add-In.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Overriding the OnShow() method, as you have shown, solved the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:47:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029591#M6236</guid>
      <dc:creator>GyanendraGurung</dc:creator>
      <dc:date>2021-02-23T15:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029594#M6237</link>
      <description>&lt;P&gt;Thanks for the suggestion. I shall look into the OnHidden() method as well. The problem was currently solved by overriding the OnShow() method. I think I will try out the OnHidden() method as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029594#M6237</guid>
      <dc:creator>GyanendraGurung</dc:creator>
      <dc:date>2021-02-23T15:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029599#M6238</link>
      <description>&lt;P&gt;I just noticed where you say "&lt;SPAN&gt;even after closing it and opening several different projects"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if OnHidden gets called when you simply open a different project.&amp;nbsp; If not, you might also need to subscribe to&amp;nbsp;ArcGIS.Desktop.Core.Events.ProjectOpenedEvent in your PaneViewModel and reset when that event fires too.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1029599#M6238</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-02-23T15:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1159297#M7986</link>
      <description>&lt;P&gt;The OnShow method&amp;nbsp;is called not only when the DockPane is opened or closed but also when it's auto hidden - collapsed into the non-client area.&lt;/P&gt;&lt;P&gt;Is there a way to distinguish when the DockPane is closed (by clicking X at top right corner) and when its auto-hidden?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 10:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1159297#M7986</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-03-30T10:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1164423#M8032</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Code behind of Dockpane is based on UserControl so you can’t listen OnClosing event or something similar.&lt;/P&gt;&lt;P&gt;I have attached modified ArcGIS Pro SDK community sample (ContentFileExplorer). This is not brilliant solution which needs many different techniques in code behind and mvvm.&lt;/P&gt;&lt;P&gt;But it works (I think)&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 15:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1164423#M8032</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-04-14T15:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1165555#M8040</link>
      <description>&lt;P&gt;Hi, thank you for your sample. It works and can distinguish when dock pane is closed and when its auto-hidden.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt;, it fails when the 'Auto-hide' (pin symbol) button is clicked. i.e. When the pane is opened, and auto-hide button is clicked, the message box shows 'x'. But it shouldn't?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 09:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1165555#M8040</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-04-19T09:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reset properties when a dockpane closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1165561#M8041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't use that code and didn't check all cases;. I only wanted to show you the way how to do your task.&lt;/P&gt;&lt;P&gt;Try to save previous state of dockpane and check if it changes. then do not react.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 09:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/reset-properties-when-a-dockpane-closes-edited-or/m-p/1165561#M8041</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-04-19T09:53:18Z</dc:date>
    </item>
  </channel>
</rss>

