<?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 close AddIn automatically when ArcGIS Pro is closed? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1506080#M11881</link>
    <description>&lt;P&gt;would it be possible to force the dockpane and all its processes to stop/cancel when closing the dockpane using the "x" with a modification of this code? I know, I could use CacellationToken to force a task or method to cancel, but implementing that in every method is messy. it would be nice to just click the x and it forces the entire dockpane and its running tasks to cancel, but the project would remain open.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2024 07:32:36 GMT</pubDate>
    <dc:creator>nadja</dc:creator>
    <dc:date>2024-07-17T07:32:36Z</dc:date>
    <item>
      <title>How to close AddIn automatically when ArcGIS Pro is closed?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1353433#M10739</link>
      <description>&lt;P&gt;I coded a dockpane as an addin. a button clicked opens the dockpane.&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I click the x on the top-right corner, the dockpane is closed. when I close ArcGIS Pro after closing the dockpane using the x, the dockpane remains closed on starting ArcGIS Pro the next time. that's great.&lt;/P&gt;&lt;P&gt;I'd like to implement this as a function. meaning that some listener realises, that ArcGIS Pro is getting closed and closes the dockpane too. the dockpane remains closed when I open ArcGIS Pro again, but can be activated again using the button.&lt;/P&gt;&lt;P&gt;How can I implement such a listener, that checks if ArcGIS Pro gets closed?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 10:53:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1353433#M10739</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2023-11-27T10:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to close AddIn automatically when ArcGIS Pro is closed?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1353511#M10740</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I am trying to catch project closing event in dock pane code:&lt;/P&gt;&lt;PRE&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;/PRE&gt;&lt;P&gt;And on project closing execute code below:&lt;/P&gt;&lt;PRE&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;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Nov 2023 15:09:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1353511#M10740</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-11-27T15:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to close AddIn automatically when ArcGIS Pro is closed?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1506080#M11881</link>
      <description>&lt;P&gt;would it be possible to force the dockpane and all its processes to stop/cancel when closing the dockpane using the "x" with a modification of this code? I know, I could use CacellationToken to force a task or method to cancel, but implementing that in every method is messy. it would be nice to just click the x and it forces the entire dockpane and its running tasks to cancel, but the project would remain open.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 07:32:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-close-addin-automatically-when-arcgis-pro/m-p/1506080#M11881</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2024-07-17T07:32:36Z</dc:date>
    </item>
  </channel>
</rss>

