Notifications (Remind about Tasks)
- 3 minutes to read
The Notifications Module allows you to display reminders for scheduler appointments or any custom business object in both WinForms and ASP.NET Web Forms applications. At the required time, a popup window is automatically invoked. In this window, a user can view alerts, cancel or delay them for a specified amount of time.
You can see the demonstration of the Notifications Module in the Notifications section of the Feature Center application that is shipped with XAF. The Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 21.2\Components\eXpressApp Framework\FeatureCenter. The ASP.NET Web Forms version of this demo is available online at https://demos.devexpress.com/XAF/FeatureCenter/.
Notifications Module Components
The Notifications Module consists of the following platform-agnostic and platform-specific components.
- NotificationsModule - Add it to your platform-agnostic module in the Module Designer.
- NotificationsWindowsFormsModule - Add it to your WinForms application project in the Application Designer.
- NotificationsAspNetModule - Add it to your ASP.NET Web Forms application project in the Application Designer.
You can add modules to your application when you create a new XAF solution using the Solution Wizard. To do this, select modules in the Choose Extra Modules step.
- To add an extra module in code, add it to the XafApplication.Modules or ModuleBase.RequiredModuleTypes list (adding a reference to the module assembly is insufficient).
Notifications Module Capabilities
The module tracks changes in any business object that support the ISupportNotifications interface. By default, these are Event objects provided by the Built-in Business Class Library for both Entity Framework and XPO. The use of Notifications with Events is described in the How to: Use Notifications with the Scheduler Event topic. You can also implement the ISupportNotifications interface in any custom business object (see How to: Use Notifications with a Custom Business Class (Implement ISupportNotifications) ). The notifications refresh frequency is specified by the NotificationsModule.NotificationsRefreshInterval property.
The Event business class has the Reminder property, which is hidden by default (this is done to preserve the Event Detail View layouts in existing applications). However, this property should be visible if you are going to use event notifications. Refer to the How to: Use Notifications with the Scheduler Event topic to see how to unhide this property.
- The reminders window is automatically invoked at the required time.
- It is possible to customize the notification view parameters and apply custom processing to the notification list by handling the NotificationsController.CustomizeNotificationViewParameters and NotificationsController.CustomProcessNotifications events accordingly.
The module adds the Show Notifications Action to the WinForms application’s status bar (bottom-right corner) and to the ASP.NET Web Forms application’s page header (top-right corner). This action allows users to re-invoke the reminders window to see the active or all notifications. The notifications count is displayed near this Action.
ASP.NET Web Forms: