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

AutoClose RadWindow

2 Answers 165 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 08 Sep 2013, 08:23 PM
I've been using the "WPFDialogManagement" controls for popup message windows previously and they allow for command like this: 

dialogWait = dialogManager.CreateWaitDialog("We're good to go. This message will self destruct in 3 seconds...", DialogMode.Ok);
dialogWait.Show(() => Thread.Sleep(3000));

This pops up the message and then auto closes after 3 seconds if the "ok" button isn't pressed.

Is it possible to get a similar behavior with the RadWindow.Alert or by another means?

Thanks...


2 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 11 Sep 2013, 02:02 PM
Hi Mike,

In order to achieve the desired scenario I would suggest that you handle the Opened event of the Alert window and implement the closing logic inside the handler. Please check the attached sample project which demonstrates the approach.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mike
Top achievements
Rank 1
answered on 16 Sep 2013, 05:12 PM
Thanks, that's exactly what I needed.

Just need to wrap it with a Dispatcher to make it work in a background process and Robert is your Fathers Brother:
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background,
    new Action(() => RadWindow.Alert(new DialogParameters { Content = "We're good to go. This message will self destruct in 3 seconds...", Opened = RadWindowOpenedTimerEvent })));

Mike...
Tags
Window
Asked by
Mike
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Mike
Top achievements
Rank 1
Share this question
or