.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

ShowViewStrategyBase.ShowMessage(MessageOptions) Method

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

public void ShowMessage(
    MessageOptions options
)
Public Sub ShowMessage(
    options As MessageOptions
)
public void ShowMessage(
    MessageOptions options
)
Public Sub ShowMessage(
    options As MessageOptions
)
public void ShowMessage(
    MessageOptions options
)
Public Sub ShowMessage(
    options As MessageOptions
)

Parameters

Name Type Description
options MessageOptions

A MessageOptions object which contains the platform-agnostic and platform-specific notification parameters.

Parameters

Name Type Description
options MessageOptions

A MessageOptions object which contains the platform-agnostic and platform-specific notification parameters.

Parameters

Name Type Description
options MessageOptions

A MessageOptions object which contains the platform-agnostic and platform-specific notification parameters.

Remarks

The following code shows the "The task is completed!" notification for two seconds. In a WinForms application, the Toast Notification with the "Success" caption is displayed. In an ASP.NET application, the dxToast widget is displayed at the bottom of the page.

MessageOptions options = new MessageOptions();
options.Duration = 2000;
options.Message = string.Format("The task is completed!");
options.Type = InformationType.Success;
options.Web.Position = InformationPosition.Bottom;
options.Win.Caption = "Success";
options.Win.Type = WinMessageType.Toast;
Application.ShowViewStrategy.ShowMessage(options);

Here, Application is the XafApplication object. For instance, it can be accessed using the Controller.Application, ActionBase.Application or Frame.Application property.

The MessageOptions.OkDelegate is executed when a user clicks the message (or, if the WinMessageOptions.Type property is set to Flyout in a WinForms application, when the OK button is clicked). If this delegate is not specified, the message is closed on a click. In the Flyout mode, the Cancel button can also be added. Use MessageOptions.CancelDelegate to provide a handler for this button.

Detailed instructions on how to use the ShowMessage method can be found in the Text Notifications topic.

See Also