<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : DialogManager closing problems</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : DialogManager closing problems</description>
  <pubDate>Sat, 11 Apr 2026 05:06:49 -700</pubDate>
  <lastBuildDate>Fri, 13 Jul 2012 12:51:24 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3398</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>DialogManager closing problems :   It&amp;#039;s done. I&amp;#039;ve...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14018#14018</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 13-Jul-2012 at 12:51pm<br /><br />It's done. I've pushed Cocktail 0.7.1 and the corresponding CocktailContrib 1.0.9 to NuGet. ]]>
   </description>
   <pubDate>Fri, 13 Jul 2012 12:51:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14018#14018</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   Thanks. If you could, that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14015#14015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1414" rel="nofollow">JChris</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 13-Jul-2012 at 7:06am<br /><br />Thanks.&nbsp;&nbsp; If you could, that would be really helpful.&nbsp; We don't have a very good workaround.]]>
   </description>
   <pubDate>Fri, 13 Jul 2012 07:06:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14015#14015</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   That is a bug. I&amp;#039;ve checked...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14009#14009</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 12-Jul-2012 at 4:36pm<br /><br />That is a bug. I've checked in a fix. Unfortunately, it just missed the 0.7 release I pushed out this morning. I can push out a 0.7.1 NuGet package with the fix if desired.]]>
   </description>
   <pubDate>Thu, 12 Jul 2012 16:36:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14009#14009</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   We have a situation where...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14007#14007</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1414" rel="nofollow">JChris</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 12-Jul-2012 at 1:08pm<br /><br />We have a situation where we:<div></div>yield return DialogManager.ShowDialogAsync(vm, <span style="color: blue;">new</span> <span style="color: maro&#111;n;">List</span>&lt;<span style="color: maro&#111;n;">DialogResult</span>&gt;() { <span style="color: maro&#111;n;">DialogResult</span>.Cancel });<div>//Check vn properties and do more stuff...</div><div> </div><div>When the DialogResult.OkCancel buttons are shown, and the Ok button clicked, all works as expected, however when we do not show the DialogResult.OkCancel button, but only the Cancel (as above), and then use our own button to handle Ok... as in:</div><div> </div><div><div>this.DialogHost().TryClose(DialogResult.Ok);</div><div> </div></div><div>the next iteration block never fires.  It seems like TryClose of the DialogHost() does not honor the DialogResult passed to it.  </div><div>Thanks for your help</div>]]>
   </description>
   <pubDate>Thu, 12 Jul 2012 13:08:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=14007#14007</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   I&amp;#039;m adding a TryClose...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13434#13434</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 26-Apr-2012 at 10:28am<br /><br />I'm adding a TryClose method to the IDialogHost interface, so you'll be able to call this.DialogHost().TryClose(DialogResult.Ok).<div>&nbsp;</div><div>I'm planning to officially release Cocktail v0.6 on May 2 together with DevForce 6.1.7. I believe we are still on track for the DF 6.1.7 release.</div>]]>
   </description>
   <pubDate>Thu, 26 Apr 2012 10:28:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13434#13434</guid>
  </item> 
  <item>
   <title>DialogManager closing problems : Here is what I tried from the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13432#13432</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1009" rel="nofollow">JohnBloom</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 26-Apr-2012 at 9:58am<br /><br /><div>Here is what I tried from the child vm:</div><div><br></div>((Screen)(this.Parent)).TryClose();<div><br></div><div>The problem that I had is that the _dialogButton in the&nbsp;DialogHostBase is null so when it enters the canclose function it callsback with false:&nbsp;</div><div><br></div><div><div>&nbsp;public override void CanClose(Action&lt;bool&gt; callback)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (_dialogButton != null)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.CanClose(callback);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (_cancelButton != null)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DialogButton button = _dialogButtons.FirstOrDefault(b =&gt; b.Value.Equals(_cancelButton));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (button == null || !button.Enabled)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DialogResult = button.Value;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base.CanClose(callback);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback(false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; finally&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _dialogButton = null;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div><br></div><div>What I ended up doing was casting the parent as a DialogHostBase and then calling the Close function since the close function sets up the _dialogButton. Here is my new code in the child vm:</div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span style="color:blue;">var</span>&nbsp;parent&nbsp;=&nbsp;((<span style="color:#2b91af;">DialogHostBase</span>)(<span style="color:blue;">this</span>.Parent)); parent.Close(parent.DialogButtons.First());</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px; white-space: normal; ">Since I know that I only have one "OK" button I am just calling first(). It works great unless you can think of a way to make it easier.</span></pre></div>]]>
   </description>
   <pubDate>Thu, 26 Apr 2012 09:58:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13432#13432</guid>
  </item> 
  <item>
   <title>DialogManager closing problems : Thanks. Looking back, that should...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13406#13406</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1009" rel="nofollow">JohnBloom</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 24-Apr-2012 at 2:09pm<br /><br />Thanks. Looking back, that should have been obvious. Your help is much appreciated.&nbsp;]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 14:09:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13406#13406</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   Missed this post somehow....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13405#13405</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 24-Apr-2012 at 2:04pm<br /><br />Missed this post somehow. If your VM implements IChild, which it automatically does if you extend from Screen or Conductor, you have a Parent property. The parent in this case is the ChildWindow's VM. Just cast it to Screen and call TryClose on it.]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 14:04:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13405#13405</guid>
  </item> 
  <item>
   <title>DialogManager closing problems : Bump :) We have a dialog that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13403#13403</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1009" rel="nofollow">JohnBloom</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 24-Apr-2012 at 12:57pm<br /><br />Bump :) We have a dialog that needs to be able to close the parent VM. It gives the user a list of options and as soon as they click an option it needs to close. Speed is the key for this dialog so we would like to avoid the user having to hit enter. Everything about the dialog works with the new stuff except we lost the ability to call TryClose() on the Manager's VM.]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 12:57:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13403#13403</guid>
  </item> 
  <item>
   <title>DialogManager closing problems :   We have a dialog thatneeds...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13351#13351</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1009" rel="nofollow">JohnBloom</a><br /><strong>Subject:</strong> 3398<br /><strong>Posted:</strong> 19-Apr-2012 at 8:34am<br /><br />We have a dialog that&nbsp;needs to close&nbsp;when the user clicks something&nbsp;other than&nbsp;the "Ok" or "Cancel" buttons. Calling TryClose() only closes the vm and not the childwindow.&nbsp;&nbsp;Is there any way that&nbsp;the child window can close itself?]]>
   </description>
   <pubDate>Thu, 19 Apr 2012 08:34:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3398&amp;PID=13351#13351</guid>
  </item> 
 </channel>
</rss>