How to Add the Notifications Module (.NET)(如何添加通知模块(.NET))
This article describes how to add the Notifications module to .NET ASP.NET Core Blazor and Windows Forms applications.
本文介绍如何将通知模块添加到.NET ASP.NET Core Blazor和Windows Forms应用程序中。
The module allows you to display reminders for scheduler appointments or any custom business object.
该模块允许您显示调度约会或任何自定义业务对象的提醒。
Step-by-Step Instructions(分步说明)
1.Add the DevExpress.ExpressApp.Notifications NuGet package to the MySolution.Module project. See the following topic for more information on how to install DevExpress NuGet packages: Choose Between Offline and Online DevExpress NuGet Feeds.
向MySolution.Module项目添加DevExpress.ExpressApp.Notifications NuGet包。有关如何安装DevExpress NuGet包的更多信息,请参阅以下主题:选择离线和在线DevExpress NuGet源。
2.In the Solution Explorer, go to the MySolution.Module project and open the Module.cs file. Add the Notifications module to the RequiredModuleTypes collection.
在解决方案资源管理器中,导航到MySolution.Module项目并打开Module.cs文件。将通知模块添加到RequiredModuleTypes集合中。
C#
//...
namespace MySolution.Module;
//...
public sealed class MySolutionModule : ModuleBase {
public MySolutionModule() {
//...
RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Notifications.NotificationsModule));
}
//...
}
3.Add the following NuGet packages to platform-specific projects in your application:
向应用程序中的特定平台项目添加以下NuGet包:
- MySolution.Blazor.Server project: DevExpress.ExpressApp.Notifications.Blazor
- MySolution.Win project: DevExpress.ExpressApp.Notifications.Win
4.In ASP.NET Core Blazor application, navigate to the MySolution.Blazor.Server\Startup.cs file and call the AddNotifications(IModuleBuilder<IBlazorApplicationBuilder>, Action<NotificationsOptions>) method.
在ASP.NET Core Blazor应用程序中,导航到MySolution.Blazor.Server\Startup.cs文件并调用AddNotifications(IModuleBuilder<IBlazorApplicationBuilder>, Action<NotificationsOptions>)方法。
In Windows Forms application, navigate to the MySolution.Win\Startup.cs file and call the AddNotifications(IModuleBuilder, Action) method.
在Windows Forms应用程序中,导航到MySolution.Win\Startup.cs文件并调用AddNotifications(IModuleBuilder, Action)方法。
C# (ASP.NET Core Blazor)
public class Startup {
// ...
public void ConfigureServices(IServiceCollection services) {
// ...
services.AddXaf(Configuration, builder => {
builder.UseApplication<MySolutionBlazorApplication>();
builder.Modules
// ...
.AddNotifications();
// ...
});
// ...
}
}
C# (Windows Forms)
//...
namespace MySolution.Win;
public class ApplicationBuilder : IDesignTimeApplicationFactory {
public static WinApplication BuildApplication(string connectionString) {
var builder = WinApplication.CreateBuilder();
builder.UseApplication<MySolutionWindowsFormsApplication>();
builder.Modules
.AddNotifications()
//...
}
//...
}
Tip
For more information about this module, refer to the following topic: How to: Use Notifications with the Scheduler Event.
有关该模块的更多信息,请参阅以下主题:如何:将通知与调度器事件配合使用。
1029

被折叠的 条评论
为什么被折叠?



