messagedialog

How to implement IWindowCloseHandler in Eclipse (e4) RCP?

喜夏-厌秋 提交于 2019-12-11 01:56:35
问题 How can I implement IWindowCloseHandler in order to display a MessageDialog before closing the application ? Here is my code : EDIT public class LifeCycle { @PostContextCreate public void postContextCreate() { // TODO start up code here System.out.println("open"); } @ProcessAdditions void processAdditions(MApplication app, EModelService modelService) { WindowCloseHandler closeHandler=new WindowCloseHandler(); MWindow window = (MWindow)modelService.find("uploadcenter.source.trimmedwindow.0",

Programmatically dismiss a MessageDialog

橙三吉。 提交于 2019-12-10 18:08:20
问题 On Windows Phone 8.1, how to programmatically dismiss a MessageDialog after the ShowAsync call? I’ve tried calling IAsyncInfo.Close(), it just throws an InvalidOperationException "An illegal state change was requested". I’ve tried calling IAsyncInfo.Cancel(). The dialog stays visible, the only result - after I tap the “Close” button, TaskCancelledException is marshaled to the awaiting routine. Update: exact behavior depends on the sequence of the calls. If IAsyncOperation.Cancel() is invoked

Colors of the TDialogService.MessageDialog

孤街浪徒 提交于 2019-12-08 12:50:42
问题 Can you explain how I can get used colors of the TDialogService.MessageDialog window? Update: Which created using this command: TDialogService.MessageDialog('Test3: Confirmation', MsgDlgType.mtConfirmation, [TMsgDlgBtn.mbOK], TMsgDlgBtn.mbOK, 0, procedure(const AResult: TModalResult) begin end); I need color of the bottom panel (Button parent) and background color of the message. I need this color to make my own dialog looks like FMX default dialog. Currently I have my own highly customizable

MessageDialog - needs to wait for user input

早过忘川 提交于 2019-12-05 21:13:34
I have a ViewModel which instantiates an event in a synchronous method. The event signals to the UI that we need a "Yes" or "No" answer from the user before continuing. I am trying to display a MessageDialog and wait until the user provides an answer - Yes or No. I am having a difficult time doing this. I currently get an UnauthorizedAccessException when trying to do this. Here's a look at the code in the UI: async Task<bool> Instance_SwitchConfirmation(string question) { MessageDialog md = new MessageDialog(question); md.Commands.Add(new UICommand("Yes", CommandInvokedHandler)); md.Commands

WinRT - MessageDialog.ShowAsync will throw UnauthorizedAccessException in my custom class

和自甴很熟 提交于 2019-12-04 00:38:00
问题 I Want to write my own control, when the ctor is invoked, a MessageBox is shown. public class Class1 { public Class1() { ShowDialog(); } void ShowDialog() { SynchronizationContext context = SynchronizationContext.Current; if (context != null) { context.Post((f) => { MessageDialog dialog = new MessageDialog("Hello!"); dialog.ShowAsync(); }, null); } } } If my class is used by someone, and write the codes as below, UnauthorizedAccessException is always thrown in dialog.ShowAsync(); void

How to prevent the ContentDialog from closing when home key is pressed in Windows phone 8.1..?

*爱你&永不变心* 提交于 2019-12-01 09:23:34
private IAsyncOperation<ContentDialogResult> _Task = null; private ContentDialog _message = null; _message = new ContentDialog() { Content = "Hello", PrimaryButtonText = "EXIT", IsPrimaryButtonEnabled = true, }; _message.PrimaryButtonClick += message_PrimaryButtonClick; _Task = _message.ShowAsync(); Here I have created a Task for content Dialog, so that I can close the ContenDialog explicitly from code. How can I prevent dialog from closing when Home key is pressed and relaunched To prevent the dialog from closing handle its Closing event and set Cancel to true in its

Add Image to JOptionPane

不羁岁月 提交于 2019-11-29 15:13:03
I'm wondering How To Add Image To MessageDialog Box. I tried the code below and the image was nowhere to be found else if(button == B){ String text = "blahblahblahblahblah"; JTextArea textArea = new JTextArea(text); textArea.setColumns(30); textArea.setLineWrap( true ); textArea.setWrapStyleWord( true ); textArea.setSize(textArea.getPreferredSize().width, 1); Font font = new Font("Verdana", Font.BOLD, 12); textArea.setFont(font); textArea.setForeground(Color.BLUE); JOptionPane.showMessageDialog( null, textArea, "Border States", JOptionPane.PLAIN_MESSAGE); image2 = new ImageIcon(getClass()

Windows Phone 8.1 override back button on a certain page

此生再无相见时 提交于 2019-11-28 07:06:19
I am developing a WP 8.1 XAML app. The first page is a login page, the second for example a history page. There will be more pages, but it doesn't matter at the moment. When I press the login button on the login page, the second (history) page appears. If I press the (physical) back button on the history page, it goes back to the login page. But I would like to disable this function. Instead of this I would like when I press the back button a MessageDialog appears and if I press again within a few seconds (for example 3 secs) the app terminates. I tried to find the answer for my questions, but

Windows Phone 8.1 override back button on a certain page

霸气de小男生 提交于 2019-11-27 01:43:09
问题 I am developing a WP 8.1 XAML app. The first page is a login page, the second for example a history page. There will be more pages, but it doesn't matter at the moment. When I press the login button on the login page, the second (history) page appears. If I press the (physical) back button on the history page, it goes back to the login page. But I would like to disable this function. Instead of this I would like when I press the back button a MessageDialog appears and if I press again within

MessageDialog ShowAsync throws accessdenied exception on second dialog

☆樱花仙子☆ 提交于 2019-11-26 17:49:39
I am trying to implement try again/cancel dialog box in windows 8. The dialog box shows fine the first time, but on clicking try again and failing again, I get a access denied exception on calling ShowAsync. I don't know why, but its strange sometimes the code works fine and I don't get the exception when I put breakpoints. really clueless here here is the code. async void DismissedEventHandler(SplashScreen sender, object e) { dismissed = true; loadFeeds(); } private async void loadFeeds() { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { try { RSSDataSource