﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Fri, 07 Sep 2012 04:25:06 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;Thanks, that zipped worked - had a quick look and it looks good - will get back if I have any issues - thanks.&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Thu, 06 Sep 2012 21:27:04 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Here, I reattached it for you.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Thu, 06 Sep 2012 05:45:37 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;&lt;p&gt;I am having a problem opeing the zip file - I have used winzip and 7zip but I get errors (Unsupported compression.......)&lt;/p&gt;
&lt;p&gt;Can you please resend.&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Thu, 06 Sep 2012 03:37:49 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Here I attached a sample. When a dialogbox open and user click 'Cancel', the dialogbox would not be closed. But it will open messagebox to notify user. If user choose 'No' in the messagebox, it will leave dialogbox as before. But if user choose 'Yes' in messagebox, it will automatically close all.&lt;/p&gt;
&lt;p&gt;I hope this scenario is the one that you were looking for. &lt;/p&gt;
&lt;p&gt;In order to do that, you would need to remove all dialogbox result in all dialogbox button. The dialogbox result should be handled manually in global dialogbox and bind it with your vm. Therefore, you would also need to use "AutoCloseDialog" as true. Please look into my sample.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Tue, 04 Sep 2012 06:16:08 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;&lt;p&gt;thanks, but this does not do what I need.&lt;/p&gt;
&lt;p&gt;Your code simply re-opens a new instance of the pop-up dialog box if the user decides they don't want to cancel.  This means any data entry stuff in the Dialog is lost as a new instance of the pop up occurs. &lt;/p&gt;
&lt;p&gt;It also seems that this code places the business logic in the calling page - I would want to business logic to reside within the dialog pop up.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;Maybe if I explain further the exact scenario. &amp;nbsp;It is to manage (add, amend , delete) lookup/drop down list items used in my application e.g.&amp;nbsp;Languages, countries, gender, age ranges, etc&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1) I have a page that displays a list box with 'lookup' items &lt;/p&gt;
&lt;p&gt;2) The use will select one and dialog will be popped up listing in a listbox for example a list of languages.&lt;/p&gt;
&lt;p&gt;3) The user can then add new item, amend and delete items in the list - this is done in memory.&lt;/p&gt;
&lt;p&gt;4) When the user clicks the Save button the in memory changes are uploaded to the database - if the user click Cancel I want to popup a message box asking for confirmation.  Ok - amendments care cancelled - Cancel the user return to the dialog box and can then click save and upload amendments to the database.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The problem I see with &lt;span style="font-family: consolas; color: red; "&gt;IsCancel&lt;/span&gt;&lt;span style="font-family: consolas; color: blue; "&gt;=&lt;/span&gt;&lt;span style="font-family: consolas; color: blue; "&gt;"True" (and your code)&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;on the Cancel button is that the dialog is closed first (and any field/in memory data).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;Simply put&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;1) Click Cancel&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;2) Ask user for confirmation&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;3) Do a 'dialog.close' piece of code if user accecpt cancel or simply leave Dialog open as it was before.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I've attached some screenshots&lt;/p&gt;
&lt;p&gt;Richard&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Tue, 04 Sep 2012 03:35:14 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I tried to create a simple project based on the provided logic.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Please have the attached sample evaluated on your end and let us hear your feedback if there is anything that I miss to reproduce the reported problem.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Fri, 31 Aug 2012 12:22:40 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;Can I have an update please - this is still not resolved, thanks&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Wed, 29 Aug 2012 07:10:21 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;I think I may not have explained properly...yes your code is valid in that this is the code used in the calling screen ie. to popup the dialog box. &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;Then when the dialog box is closed (&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;DialogResult.OK or &lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;DialogResult.Cancel) the calling code can use the logic.  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;&lt;b&gt;This code I understand runs when the popped up window is closed&lt;/b&gt; - I don't want that - I want to prevent the popped up window closing if the user answers 'No' to my &lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;MessageBoxServiceProvider.Show(....) message box.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;Logic.....&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style="color: rgb(63, 63, 63); font-family: 'lucida sans unicode'; "&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;Window1 pops up Window2 using code as you offer above.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style="color: rgb(63, 63, 63); font-family: 'lucida sans unicode'; "&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;Window2 has two buttons - Save  and Cancel&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;&lt;font style="color: rgb(63, 63, 63); font-family: 'lucida sans unicode'; "&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;Save (mvvm code) saves data and closes Window2 using &lt;/span&gt;&lt;/font&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt; DialogBoxServiceProvider.CloseCurrentWindow() - this works.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;Cancel (mvvm code) display Messagebox asking confirmation from user for Cancel Action.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;If user says 'No Cancel' then return to Window2 (works)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;&lt;span style="line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;If user says 'Yes - Cancel' then this code does not now work &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;DialogBoxServiceProvider.CloseCurrentWindow();&amp;gt; - it's as if the &lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap; font-size: 10pt; "&gt;DialogBoxServiceProvider.CloseCurrentWindow(); is closing the MessageBox and not the Window2.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Wed, 29 Aug 2012 05:51:12 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;If you are using our DialogBoxResult, it should automatically close the dialog when ok or cancel. &lt;span style="font-size: 10pt; "&gt;We provide the DialogBoxResult for user to run some command or validation before close the dialog.&lt;br /&gt;Normally, if you use UXDialogBox, it should be something like this:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt; DialogBoxServiceProvider.GetInstanceAsync("ClientUIDataApp3.Views.UXDialogBox1",
                (dialog) =&amp;gt;
                {
                    dialog.ShowDialog(null, (dialogResult) =&amp;gt;
                        {
                            if (dialogResult == DialogResult.OK)
                            {
                            }
                            else if (dialogResult == DialogResult.Cancel)
                            {
                            }
                        });
                });&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Issue closing UXDialogBox</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Issue-closing-UXDialogBox/</link><pubDate>Tue, 28 Aug 2012 04:47:21 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can't seem to be able to close a dialog box when I first ask/promy user to confirm closure e.g.&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: white; font-family: consolas; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt; "&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;                       &amp;nbsp;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode'; "&gt;MessageBoxServiceProvider.Show(&lt;/span&gt;&lt;span style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;"About to exit.  If you have added new items or amended items your changes will be lost if you haven't saved.  Are you sure you want to proceed/cancel?",&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;                        "Proceed and Cancel All Changes?", MessageBoxButton.YesNo, MessageBoxImage.Warning,
                        (dialogResult) =&amp;gt;
                        {
                            if (dialogResult != DialogResult.Yes)
                            {
                                return;
                            }
                           
                            DialogBoxServiceProvider.CloseCurrentWindow();
                           
                        });&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre style="font-family: consolas; font-size: 13px; background-color: white; "&gt;&lt;span style="background-color: white; "&gt;I am using MVVM.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-family: consolas; font-size: 13px; background-color: white; "&gt;Thanks&lt;/pre&gt;
&lt;p /&gt;</description></item></channel></rss>