Back to Devexpress

NotificationsOptionsBase.NotificationsRefreshInterval Property

expressappframework-devexpress-dot-expressapp-dot-notifications-dot-notificationsoptionsbase.md

latest3.6 KB
Original Source

NotificationsOptionsBase.NotificationsRefreshInterval Property

Specifies how often XAF refreshes notifications.

Namespace : DevExpress.ExpressApp.Notifications

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

NuGet Package : DevExpress.ExpressApp.Notifications

Declaration

csharp
public TimeSpan NotificationsRefreshInterval { get; set; }
vb
Public Property NotificationsRefreshInterval As TimeSpan

Property Value

TypeDefaultDescription
TimeSpan5 minutes

A TimeSpan value that specifies the time that passes before XAF refreshes notifications again.

|

Remarks

The following example demonstrates how to specify this property:

csharp
namespace MySolution.Blazor.Server;

public class Startup {
    public void ConfigureServices(IServiceCollection services) {
        // ...
        services.AddRazorPages();
        services.AddServerSideBlazor();
        services.AddHttpContextAccessor();
        services.AddScoped<CircuitHandler, Services.Circuits.CircuitHandlerProxy>();
        services.AddXaf(Configuration, builder => {
            builder.UseApplication<MySolutionBlazorApplication>();
            // ...
            builder.Modules
                // ...
                .AddNotifications(options => {
                    options.CanAccessPostponedItems = true;
                    options.NotificationsRefreshInterval = TimeSpan.FromSeconds(1);
                    options.NotificationsStartDelay = TimeSpan.FromSeconds(15);
                    options.ShowDismissAllAction = true;
                    options.ShowNotificationsWindow = false;
                    options.ShowRefreshAction = true;
                });
        });
    };
}
csharp
using DevExpress.ExpressApp.ApplicationBuilder;
using DevExpress.ExpressApp.Win.ApplicationBuilder;

namespace YourApplicationName.Win;

public class Startup {

  public class ApplicationBuilder : IDesignTimeApplicationFactory {
      public static WinApplication BuildApplication(string connectionString) {
          var builder = WinApplication.CreateBuilder();
          builder.UseApplication<MySolutionWindowsFormsApplication>();
          builder.Modules
              // ...
              .AddNotifications(options => {
                  options.CanAccessPostponedItems = true;
                  options.NotificationsRefreshInterval = TimeSpan.FromSeconds(1);
                  options.NotificationsStartDelay = TimeSpan.FromSeconds(15);
                  options.ShowDismissAllAction = true;
                  options.ShowNotificationsWindow = false;
                  options.ShowRefreshAction = true;
              })
          // ...
      }
      // ...
  }
  // ...
}

See Also

NotificationsOptionsBase Class

NotificationsOptionsBase Members

DevExpress.ExpressApp.Notifications Namespace