I'm having a problem with RadDesktopAlertManager. I call multiple times high frequency to ShowAlert and CloseAlert, and sometimes a gaps between two consecutive alerts is created.
I'm sorry, it's impossible for me to reproduce the issue because my application is very big and complex, and it doesn't happen in small project as the one you attached (I tried a lot).
I configured RadDesktopAlertManager to display alerts at AlertScreenPosition.BottomLeft, with some offset.
I'm using a custom style. Do you think that the style matters?
I've managed to reproduce it, please refer to the attached file (change its extension to xaml.cs - for some reason I wasn't able to attach cs file)
It happens when trying to add an alert as a result of other alert's Closed event.
Thank you for the file, David. This was very useful. Before that I was left with the impression that the issue was the margin between the alerts. However, now I see that you are talking about the space between the first alert and the bottom right part of the screen.
This happens because the alert manager is keeping an offset position so that it can stack alerts one over another. This offset is updated when the show/hide animation of the associated alert is executed. In your case, you are closing an alert, which fires its Closed event, but after this the close animation is still running, so the offset is not yet updated. To achieve your requirement, you will need to wait for the animation. One way to do so, is to use a dispatcher in order to delay the opening of the next alert. For example:
private void Alert_Closed(object sender, Telerik.Windows.RadRoutedEventArgs e)
var closedAlert = (RadDesktopAlert)sender;
closedAlert.Closed -= Alert_Closed;
// Try add next alert
var nextAlert = m_alertsCollection.FirstOrDefault();
if (nextAlert != null)
Dispatcher.BeginInvoke(new Action(() =>
I hope that helps.
Thank you for the answer, and I'm sorry about the misunderstanding (actually, in my real application there was also a margin between the alerts, but this is the same problem).
Your solution works indeed in our small application. But, my real application is very complex and consists of video and map components which do a lot of extended work in the UI thread, and I'm afraid that using ApplicationIdle priority will delay the alert appearance for unreasonable time. So I have a few questions/suggestions:
1) Is it safe enough to use ApplicationIdle in that scenario?
2) Is there any other event that notify when the animation running has ended?
3) Or, is there a constant value of milliseconds which I can wait (using a Timer or something like that) to ensure that animation running has ended, before calling ShowAlert?
(1) Using dispatcher doesn't guarantee that the code will execute at the expected time. However, from my experience I can say that it works pretty constant most of the time. If ApplicationIdle doesn't work for you, you can try different DispatcherPriority.
(2) There is no event for the animation end. You can disable the closing animation by calling the CloseAlert() method with its second parameter (useAnimation) set to False.