<?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: Open modal dialog and wait for user input in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279110#M9684</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I'm also looking modal use using the ProWindow and have implemented something similar to your example as below.&amp;nbsp; However ShowDialog() doesn't appear to be blocking and the code continues executing although close() is never called and I've tested this by debugging on the closed event handler&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (_oauthConsent != null)
return;
_oauthConsent = new OAuthConsent();
_oauthConsent.Owner = FrameworkApplication.Current.MainWindow;
_oauthConsent.Closed += _oauthConsent_Closed;

this._oauthConsent.webBrowser.NavigationStarting += new EventHandler&amp;lt;Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs&amp;gt;(browser_Navigated);

this._oauthConsent.webBrowser.Source = new Uri(this._uri);

var result = this._oauthConsent.ShowDialog();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 00:06:47 GMT</pubDate>
    <dc:creator>DavidMcCorkindale1</dc:creator>
    <dc:date>2023-04-17T00:06:47Z</dc:date>
    <item>
      <title>Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810111#M2320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I open a&amp;nbsp;modal dialog from within the code and wait for user&amp;nbsp;to interact with it before proceeding&amp;nbsp;with the rest of the code? The functionality that I am looking for in the pro sdk is similar to the the one at this link&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.window.showdialog?redirectedfrom=MSDN&amp;amp;view=netframework-4.8#System_Windows_Window_ShowDialog"&gt;https://docs.microsoft.com/en-us/dotnet/api/system.windows.window.showdialog?redirectedfrom=MSDN&amp;amp;view=netframework-4.8#System_Windows_Window_ShowDialog&lt;/A&gt;&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/86730"&gt;Uma Harano&lt;/A&gt;&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2020 21:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810111#M2320</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2020-04-06T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810112#M2321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marvis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;You need to add a ProWindow (via the ArcGIS Pro SDK&amp;nbsp;item templates) to your add-in.&amp;nbsp; &lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/487666_ProWin.png" /&gt;By default the ProWindow you add to your project will not be MVVM, but you can use the newly created ProWindow like any out-of-box WPF window.&amp;nbsp; You can find an example of such a ProWindow in community samples here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/f5f9dda18efa173a56d128f3ea64ca34ac3f68a9/Framework/CustomCategories/UI" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/f5f9dda18efa173a56d128f3ea64ca34ac3f68a9/Framework/CustomCategories/UI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then you can use the following snippet to instantiate the ProWindow for the Report Categories sample linked above as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;internal&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ShowReports&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Button
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; UI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ReportsWindow _reportsWnd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&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;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnClick&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;//already open?&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_reportsWnd &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&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="punctuation token"&gt;;&lt;/SPAN&gt;
      _reportsWnd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;UI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ReportsWindow&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;
      _reportsWnd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Owner &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FrameworkApplication&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MainWindow&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      _reportsWnd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Closed &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;o&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; _reportsWnd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&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;
      _reportsWnd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ShowDialog&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;/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;&amp;nbsp; One problem is that the ShowDialog() method is in an internal namespace&amp;nbsp;but Visual Studio should be able to locate the method via intellisense.&amp;nbsp; This is a bug that we will fix as soon as possible.&amp;nbsp; This is also the reason why ShowDialog doesn't show up in the Pro SDK API help documentation.&amp;nbsp; ShowDialog returns true if you set the&amp;nbsp;DialogResult property to true before calling Close() on the ProWindow.&amp;nbsp; &amp;nbsp;Let me know if you have any questions or if you need of a MVVM sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810112#M2321</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T09:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810113#M2322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;, the showDialog does what I needed thanks but I would appreciate an MVVM sample as that's what I am familiar with thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 18:03:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810113#M2322</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2020-04-08T18:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810114#M2323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hi Marvis,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I added a sample showing how to implement a modal ProWindows dialog.&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/ProWindowMVVM"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/ProWindowMVVM&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2020 19:23:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/810114#M2323</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-04-09T19:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279110#M9684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I'm also looking modal use using the ProWindow and have implemented something similar to your example as below.&amp;nbsp; However ShowDialog() doesn't appear to be blocking and the code continues executing although close() is never called and I've tested this by debugging on the closed event handler&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (_oauthConsent != null)
return;
_oauthConsent = new OAuthConsent();
_oauthConsent.Owner = FrameworkApplication.Current.MainWindow;
_oauthConsent.Closed += _oauthConsent_Closed;

this._oauthConsent.webBrowser.NavigationStarting += new EventHandler&amp;lt;Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs&amp;gt;(browser_Navigated);

this._oauthConsent.webBrowser.Source = new Uri(this._uri);

var result = this._oauthConsent.ShowDialog();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 00:06:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279110#M9684</guid>
      <dc:creator>DavidMcCorkindale1</dc:creator>
      <dc:date>2023-04-17T00:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279318#M9689</link>
      <description>&lt;P&gt;I tested your code snippet and it works fine.&amp;nbsp; I don't understand what you mean with "ShowDialog() is not blocking".&amp;nbsp; What version of Pro are you using and how do you close the Pro Window?&amp;nbsp; &amp;nbsp; Try using the 'X' on the top right of the window to close it.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1681750786095.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68172i42B282A85378986E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1681750786095.png" alt="Wolf_0-1681750786095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's the snippet i used for the ProWindow above (it's identical to what you have except for the properties).&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;try
{
  if (_oauthConsent != null)
    return;
  _oauthConsent = new ModalProWindow();
  _oauthConsent.Owner = FrameworkApplication.Current.MainWindow;
  _oauthConsent.Closed += (o, e) =&amp;gt; { _oauthConsent = null; };
  //this._oauthConsent.webBrowser.NavigationStarting += new EventHandler&amp;lt;Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs&amp;gt;(browser_Navigated);
  //this._oauthConsent.webBrowser.Source = new Uri(this._uri);
  var result = this._oauthConsent.ShowDialog();
}
catch (Exception ex) 
{
  MessageBox.Show($@"ex");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 17:02:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279318#M9689</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-17T17:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279963#M9714</link>
      <description>&lt;P&gt;I'm running ArcGIS Pro 3.1.0.&amp;nbsp; What I mean by "not blocking" is the window doesn't act modal when calling "ShowDialog()". I've tested calling the IsModal() method before and after ShowDialog and it always returns false.&amp;nbsp; In the example it seems to return false as the result and it keeps execution continues to any code following even though the window isn't closed.&amp;nbsp; &amp;nbsp;I've even checked by debugging the window closed event and it's never called until the window is explicitly closed (as expected).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 22:55:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1279963#M9714</guid>
      <dc:creator>DavidMcCorkindale1</dc:creator>
      <dc:date>2023-04-18T22:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Open modal dialog and wait for user input</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1280039#M9715</link>
      <description>&lt;P&gt;Not sure what your code is doing, but i attached a project with two Modal ProWindows.&amp;nbsp; One is WinForms based and one is Mvvm based.&amp;nbsp; Please build and run this project and see if this satisfies your needs.&lt;/P&gt;&lt;P&gt;Here is one of these 'modal' Pro Windows, and no user input for ArcGIS Pro is accepted until you close the Pro Window.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1681873191594.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/68354iDF1FD3681B46F5A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1681873191594.png" alt="Wolf_0-1681873191594.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 03:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/open-modal-dialog-and-wait-for-user-input/m-p/1280039#M9715</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-19T03:00:23Z</dc:date>
    </item>
  </channel>
</rss>

