iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
I have designed a pop-up dialogbox form to mimic the Register form (using the register form from the MVVM business template example) . So I am looking to get the same functionality except in a pop-up form call from some other form in my app.
I am having two problems.
1) MessageBoxServiceProvider.Show(
ApplicationStrings.RegistrationSuccessMessage, ApplicationStrings.RegistrationSuccessCaption, (dialogResult) => { NavigationServiceProvider.Navigate(new Uri("/Home", UriKind.Relative), currentFocus); } );
This code does not now work (in the UXDialogBox version)
2) After creating a new account I just want close the form but am struggling to do so.
I have tried setting the Create User's button dialog result property to 'OK' and this does indeed close the dialog box, however it closes the dialog box even if there is an error (validation or other type of error). Can you please advise how this can be done (using MVVM), thanks.
Thanks
Richard
Hello Richard,
Here, I attached the hotfixes for you. Please apply to C:\Program Files\Intersoft Solutions\ClientUI 5\Silverlight 4\Bin.
Regards,
Handy
the hotfix has worked, many thanks
Did you use the same NavigationServiceProvider in our template? If you want to see our implementation about UXDialogBox with MVVM, I suggest to check our sample, Contacts MVVM C# Sample. It sure will show you how to open,close or handle error correctly.
Regards,Handy
thanks for your reply. I looked at the sample and did the following to that sample:
in XAML....
<Intersoft:UXButton Content="Save" Width="80" IsDefault="True" Command="{Binding SaveCommand}" DialogResult="{Binding DialogResult1}"/>
In VM....
private string _DialogResult1;
public string DialogResult1 { get { return _DialogResult1; } set { _DialogResult1 = value; OnPropertyChanged("DialogResult1"); } } private void SaveContact(object parameter) { if (this.Contact.Id == "MARIA") // simulate an error { DialogResult1 = "None"; MessageBoxServiceProvider.Show( "Error saving?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Question, (dialogResult) => { if (dialogResult == DialogResult.Yes) { } }); } else DialogResult1 = "OK"; // in this sample, the save logic is implemented in ContactsViewModel for simplicity. // to prevent the dialog box to close (i.e, due to errors in saving), // bind to the DialogResult property and set it to None. }
Firstly, this sort of works. The Save button does not close the pop-up as expected but when the ID is not equal to Maria (simulate an error) the dialog pop up does not close until your click for the second time. So the binding dos not work properly (or arrives too late). Can you please advise.
Secondly, the message box bit does not work at all - can you please advise.
Yes, If you set it programmatic via code, it will not work. You would need to close it manually.However, the current DialogBoxServiceProvider does not show how to close. You can find in our Contacts MVVM DevForce C# Sample. Or, perhaps you can add the close function in DialogBoxSeviceProvider.
internal static void CloseCurrentWindow() { FrameworkElement element = ISFocusManager.GetFocusedElement() as FrameworkElement; IWindow window = UXWindow.GetWindowHost(element); if (window != null) window.Close(); }
Then, call DialogBoxServiceProvider.CloseCurrentWindow();, to close DialogBox.Btw, can you let me know more detail about message box issue?
the close dialog code worked okay, thanks.
I can't seem to get the message box working in a UXDialog control. Even after the pop-up has closed it does not work.... this code pops up a box, enter new user details and closes - the code goes through to
MessageBoxServiceProvider.Show().... but nothing happens. Additionally I can't seem to use this code inside (MVVM) CreateAccount uxdialogbox control.
private void CreateAccount(object parameter) { DialogBoxServiceProvider.GetInstanceAsync(DialogBoxServiceProvider.CreateAccount, (dialogBox) => { DialogBoxServiceProvider.Show(dialogBox, (dialogResult) => { if (dialogResult == DialogResult.OK) { MessageBoxServiceProvider.Show( ApplicationStrings.RegistrationSuccessMessage, ApplicationStrings.RegistrationSuccessCaption, (dialogResult1) => { } ); } }); }); }
Can you also advise on how to pass data into the pop-up dialog and also return data when the dialog closes, many thanks
Can you send me your simple runable project that replicates this issue? And what kind of data that you would like to pass?
to show that a model popup does not permit message boxes I have amended the 'Contacts_MVVM_SL' sample you provide. See attached screen shot. Code taken from ContactEditViewModel with my amendemnts underlined.
public DelegateCommand SaveCommand { get; set; }
public DelegateCommand ShowMessageCommand { get; set; } public DelegateCommand ChangeStateCommand { get; set; } // Constructor public ContactEditViewModel(Contact contact, bool isNewContact) { _contact = contact; _contact.PropertyChanged += new PropertyChangedEventHandler(Contact_PropertyChanged); _isNewContact = isNewContact; this.SaveCommand = new DelegateCommand(SaveContact, CanSaveContact); this.ChangeStateCommand = new DelegateCommand(ChangeState); this.ShowMessageCommand = new DelegateCommand(ShowMessage); } private void ShowMessage(object parameter) { MessageBoxServiceProvider.Show( "Test?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, (dialogResult) => { if (dialogResult == DialogResult.Yes) { } }); }
I have edited the viewmodel(ContactEditViewModel) and view to add a button that simply displays a message box (ShowMessage)
<Intersoft:UXButton Content="Button" Name="uXButton1" Command="Binding ShowMessage"/>
This does not work and if I wanted to pop up another Dialog box from a button on this screen - this does not also work.
I would consider this requirement to work as 'standard' line of business stuff!!
Is this a bug? or can you advise on how to achieve. Thanks
I can show Message box. You used incorrect way in binding command.
It should : <Intersoft:UXButton Content="Button" Name="uXButton1" Command="{Binding ShowMessageCommand}"/>
You should bind to command, not void function. The way you filled the command is also wrong.
I have amended my errors..but it still does not work. However when I change the start page of the SL project to this one ..... UXShell_Desktop.SLTestPage.aspx (instead of Contacts_MVVM.SLTestPage.aspx) - the messagebox works. Please see attached screenshots. Any advice here....I don't know how the two projects work and maybe you are better at understanding this.
Regards
Weird. It works in here. Here, I attached my full project. It seems there is something that you were missing.
thanks for the zip file.....still no joy - downloaded your project and still not working (but as per last email if I run through UXShell_Desktop.SLTestPage.aspx it works). When debugging it goes through the code okay, but no pop-up.
I am using VS2010 sp1 and have tried on two different machines.
Could do with some other users trying as well and getting some feedback from them.
I await further instruction. Thanks.
Please confirm whether you are using ClientUI 5 or not? Please check if you also have used our latest hotfixes. If not, you can get the update by using UpdateManager. After that, please let me know whether the issue still persists or not.
Hi Handy
I am using Clinet UI5. The update manager says there is a hotfix 5.0.5000.4 to be applied. This is blocked. Is there a manual option to getting teh hotfix. Thanks.
It would be blocked if you have not put your LicenseKey in LicenseManager. However, there is another way to get and apply it manually. Go to http://dev2.intersoftpt.com, and inside MyComponents, there should a tab option to get the hotfix.
I am running in evaluation mode and so do not have licence key. Please advise
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname