This is a migrated thread and some comments may be shown as answers.

Trying to emulate SL5 MessageBox

2 Answers 27 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rob Ainscough
Top achievements
Rank 1
Rob Ainscough asked on 06 Sep 2012, 07:02 PM
Does Telerik have support for a SL5 like MessageBox ... needs to be synchronous and work just like the SL5 MessageBox (execution stops until input is made on the messagebox) ... but needs to look better (i.e. ability to make it look integrated into my application)?

Hoping for a simple solution, what I've read so far consists of 1000's of lines of code/xaml to implement a simple MessageBox (which isn't progress IMHO).

Thanks, Rob.

2 Answers, 1 is accepted

Sort by
0
Rob Ainscough
Top achievements
Rank 1
answered on 06 Sep 2012, 07:59 PM
So I tried out the RadWindow as the documentation says it "Modal" ... well it's not really modal.

It looks like a ChildWindow running asynch requiring a call back to an OnClosed method.  It does NOT act like a true MessageBox where execution stops until a response is made.  So I'm not sure how this could work or why anyone would want to use it?

For example: in a _Deleting event I need to set the e.Cancel = True or False based on whether or not a user confirms the Delete action ... there is NO WAY RadWindow can be used in this _Deleting event.  RadWindow.Confirm() doesn't stop execution in the _Deleting event, it acts just like any other ChildWindow.  So it would be impossible for me to set e.Cancel.

Asynchronous operations are NOT Modal by definition so I have no idea why Telerik are trying to sell this "Modal" when it isn't??

Rob.
0
Vladi
Telerik team
answered on 11 Sep 2012, 02:45 PM
Hi Rob,

The modal dialogs in Silverlight are not really modal - they block the UI, but not the thread. To achieve the wanted behavior of a modal Window you will need to hook-up to the Closed event and execute the logic you want to be executed after closing the dialog box in the event handler. We implemented the dialogs in this way because Silverlight does not allow us to block the UI thread. MessageBox is using a special browser notification window which is not part of Silverlight.

You could find more about the Alert, Prompt and Confirm methods here.

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Window
Asked by
Rob Ainscough
Top achievements
Rank 1
Answers by
Rob Ainscough
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or