static Command GenericAlert(WindowFrame parent, MessageDescription message) { if (message.ApplyToAllButton != null) { return(message.ApplyToAllButton); } IAlertDialogBackend backend = Toolkit.CurrentEngine.Backend.CreateBackend <IAlertDialogBackend> (); backend.Initialize(Toolkit.CurrentEngine.Context); if (message.Icon != null) { message.Icon.InitForToolkit(Toolkit.CurrentEngine); } using (backend) { Command res = null; Toolkit.CurrentEngine.InvokePlatformCode(delegate { res = backend.Run(parent ?? RootWindow, message); }); if (backend.ApplyToAll) { message.ApplyToAllButton = res; } return(res); } }
static Command GenericAlert(WindowFrame parent, MessageDescription message) { if (message.ApplyToAllButton != null) { return(message.ApplyToAllButton); } IAlertDialogBackend backend = WidgetRegistry.CreateBackend <IAlertDialogBackend> (typeof(IAlertDialogBackend)); using (backend) { var res = backend.Run(parent ?? RootWindow, message); if (backend.ApplyToAll) { message.ApplyToAllButton = res; } return(res); } }