{"id":110108,"date":"2024-08-07T07:00:00","date_gmt":"2024-08-07T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=110108"},"modified":"2024-08-07T10:31:55","modified_gmt":"2024-08-07T17:31:55","slug":"20240807-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20240807-00\/?p=110108","title":{"rendered":"How do I know when the user has finished interacting with the <CODE>Accounts&shy;Settings&shy;Pane<\/CODE>?"},"content":{"rendered":"<p>The <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show<\/code> method shows the accounts settings pane and returns immediately. How do you know when the user has closed the pane?<\/p>\n<p>If the user selects one of your commands, you get a notification in the form of the <code>Invoked<\/code> event on that command. But what if the user closes the pane without selecting anything?<\/p>\n<p>Instead of using the <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show<\/code> method, use the <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show\u00adManage\u00adAccounts\u00adAsync<\/code> method. The <code>Show\u00adManage\u00adAccounts\u00adAsync<\/code> method does the same thing as <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show<\/code>, except that it returns an <code>IAsync\u00adAction<\/code> which completes when the pane is closed (for whatever reason).<\/p>\n<p>(Dirty secret: Really, it&#8217;s the other way around. The <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show<\/code> method just calls the <code>Accounts\u00adSettings\u00adPane.<wbr \/>Show\u00adManage\u00adAccounts\u00adAsync<\/code> method. and throws away the <code>IAsyncAction<\/code>.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use the version that runs an asynchronous operation.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-110108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can use the version that runs an asynchronous operation.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=110108"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=110108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=110108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=110108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}