5 Answers, 1 is accepted
Thank you for your interest in our products.
You can get the dialog result of the confirm window by adding an additional event handler to your RadWindow.Confirm method like this:
RadWindow.Confirm(dialogParams.Content, New EventHandler(Of WindowClosedEventArgs)(AddressOf OnClosed))
Private
Sub
OnClosed(sender
As
Object
, e
As
WindowClosedEventArgs)
Dim result As System.Nullable(Of Boolean) = e.DialogResult
End Sub
After that you have the result stored in the result variable.
For more information you can visit http://demos.telerik.com/silverlight/#Window/APC or see the attached sample project.
Best regards,
Konstantina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You could do the same using only the DialogParameters - please check my answer in the other forum thread:
http://www.telerik.com/forums/set-the-title-when-using-the-radwindow-alert()-method
For more details regarding the DialogParameters - check the following article from our help documentation:
http://docs.telerik.com/devtools/silverlight/controls/radwindow/features/predefined-dialogs
Hope this helps.
Regards,
Kalin
Telerik by Progress
This seems really convoluted way to do a simple thing... You really can't just get the result from a confrim?
I'm looking to essentially replace MessageBox with these functions allowing my own styling and themes to fit with my application. What I need is to be able to do something like:
if(confirm.DialogResult==true)
{ ...do something...}
else
{...do something else...}
If I read this right it looks like I would have to create a separate method to handle the result of the dialog, effectively pushing me out of the method I'm in and adding quite a bit of complexity to the code. Not to mention that if I need variables from the method I'm calling from I would have to store them globally somehow or...??? I'm not sure. Those static methods are always modal so why can they not just return the dialog result?
I am posting my answer here so it could be available for the community.
"In its current implementation of RadWindow using the Closed event is the only approach that you could use to notify when the window gets closed and to take the DialogResults.
However, you could raise the event through a lambda expression and use the variables inside it:"
string
someString =
"string"
;
RadWindow.Confirm(
new
DialogParameters() { Content =
"Some content"
, Header =
"Confirm"
}, (sender, args) =>
{
if
(args.DialogResult ==
true
)
{
//you could use your variables here
someString =
"Changed from code"
;
}
});
"This is the only approach that we could suggest you for your scenario."
We hope this will help you.
Regards,
Nasko
Telerik by Progress