学习022-04 How to Add the Notifications Module (.NET)(如何添加通知模块(.NET))

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.

有关该模块的更多信息,请参阅以下主题:如何:将通知与调度器事件配合使用。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汤姆•猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值