Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

NotificationsController.CustomProcessNotifications Event

Occurs before XAF invokes a notification window.

Namespace: DevExpress.ExpressApp.Notifications

Assembly: DevExpress.ExpressApp.Notifications.v24.2.dll

#Declaration

public event EventHandler<NotificationItemsEventArgs> CustomProcessNotifications

#Event Data

The CustomProcessNotifications event's data class is NotificationItemsEventArgs. The following properties provide information specific to this event:

Property Description
Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.
NotificationItems Gets the list of INotificationItem objects to be processed.

#Remarks

Handle the CustomProcessNotifications event to apply custom processing to the notification list received from the Notifications Service. To suppress the default logic, set the Handled property to true and call the NotificationsController.RefreshNotifications method to display the notification list after XAF runs your custom logic.

C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Notifications;
using DevExpress.Persistent.Base.General;

namespace MySolution.Module.Controllers;
public class MyController : WindowController {
    protected override void OnActivated() {
        //...
        var controller = Frame.GetController<NotificationsController>();
        controller?.CustomProcessNotifications += Controller_CustomProcessNotifications;
    }
    private void Controller_CustomProcessNotifications(object sender, DevExpress.Persistent.Base.General.NotificationItemsEventArgs e) {
        foreach(INotificationItem item in e.NotificationItems) {
            //...
        }
        e.Handled = true;
        ((NotificationsController)sender).RefreshNotifications();
    }
}
See Also