AutoClose RadWindow

3 posts, 1 answers
  1. Mike
    Mike avatar
    28 posts
    Member since:
    Apr 2013

    Posted 08 Sep 2013 Link to this post

    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. Answer
    Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 11 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mike
    Mike avatar
    28 posts
    Member since:
    Apr 2013

    Posted 16 Sep 2013 Link to this post

    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...
Back to Top