Can some one post a sample code to demonstrate how to use XamDialogWinodw to get User Input.
For example, I have a main window, use click a button to open the XamDialogWinodw. Then the user will enter some text in the XamDialogWinodw then close it. I want to show what user entered in the main window.
This use case is more like using XamDialogWinodw as a Messagebox with input box, which is not available.
Preferably, I want to make this re-usable.
Thanks
Ran Tao
Hello Ran,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Thanks, Krasimir!
What I am looking for is to mimic the messagebox or form.showdialog(owner) function.
For example, you have a code
void mycode(int thisnumber)
{
if (thisnumber > 100) {
//show messagbox here and ask user for a new number
} else
//do something else here.
}
//more code here
The trick here is that if I use traditional way, the main thread is blocked by the messagebox until user enter something and click "OK" in the dialog box. It seems to me that xamDialogWindow does not have showdialog() method to block the main thread.
Please let me know if you can understand my question.
Thanks.
Ran
You cannot block the UI thread using XamDialogWindow (from a technical standpoint there is no way that we can make the control do that). The best approach is to make the dialog modal to prevent a user from interactive with the parent page while the dialog is shown.
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamDialogWindow_Modal_and_Modeless_Dialog_Windows.html
Once the control is added to the Visual Tree, you can use the controls Show() and Close() methods to programatically toggle the WindowState of the control.
Devin