Sometimes you want to notify end-users about successful execution of a command (e.g., saving changes) or perform additional actions after a user clicks or closes such a notification, like in Microsoft Outlook. Displaying text notifications (e.g. confirmation messages, warnings, errors) has been made simpler for desktop and Web XAF applications. Use our new Application.ShowViewStrategy.ShowMessage method that runs equally well across WinForms and ASP.NET platforms.
Type: |
| Loading… |
|
|
|
Position: |
| Loading… |
|
|
|
using DevExpress.ExpressApp; using DevExpress.ExpressApp.Actions; using DevExpress.ExpressApp.SystemModule;
namespace FeatureCenter.Module.Messages { public class ShowMessagesController : ObjectViewController<DetailView, Messages>{ public ShowMessagesController() { SimpleAction action = new SimpleAction(this, "ShowMessage", "ShowMessageCategory"); action.Execute += action_Execute; } void action_Execute(object sender, SimpleActionExecuteEventArgs e) { MessageOptions options = new MessageOptions(); options.Duration = 2000; options.Message = "Message"; options.Web.Position = InformationPosition.Bottom; options.Type = InformationType.Success; options.Win.Caption = "Caption"; options.CancelDelegate = CancelDelegate; options.OkDelegate = OkDelegate;
Application.ShowViewStrategy.ShowMessage(options); } private void OkDelegate() { } private void CancelDelegate() { } } }
|
|