User Tools

Site Tools


notes:uwp:messagedialog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:uwp:messagedialog [2016/07/05]
admin
notes:uwp:messagedialog [2016/08/16]
admin
Line 1: Line 1:
 ====== MessageDialog in UWP ====== ====== MessageDialog in UWP ======
  
-**Example**: ​Show a simple MessageDialog:​+**Example**: ​Display ​a simple MessageDialog:​
  
 {{uwp_messagedialog1.png}} {{uwp_messagedialog1.png}}
Line 11: Line 11:
  
  
-**Example**: ​Show a confirmation dialog:+**Example**: ​Display a simple MessageDialog with the button OK instead of Close: 
 +<code csharp>​ 
 +MessageDialog msg = new MessageDialog("​The message displayed to the user.",​ "​Title"​);​ 
 +msg.Commands.Add(new UICommand("​OK",​ command => { })); 
 +await msg.ShowAsync();​ 
 +</​code>​ 
 + 
 + 
 +**Example**:​ Display ​a confirmation dialog:
  
 {{uwp_messagedialog2.png}} {{uwp_messagedialog2.png}}
Line 52: Line 60:
  
  
-**Example**: ​Show a dialog that returns command IDs:+**Example**: ​Display ​a dialog that returns command IDs:
  
 {{uwp_messagedialog3.png}} {{uwp_messagedialog3.png}}
Line 75: Line 83:
  
  
-**Example**: ​Show a dialog and use its return value on UI. Note that we need to use a //​Dispatcher//​ object to run code in the UI thread. Also, this example uses the //​Completed//​ event handler.+**Example**: ​Display ​a dialog and use its return value on UI. Note that we need to use a //​Dispatcher//​ object to run code in the UI thread. Also, this example uses the //​Completed//​ event handler.
  
 <code csharp> <code csharp>
Line 111: Line 119:
  
  
-**Example**: ​Show a dialog and wait five seconds for the user to make a selection. If no selection is made, dismiss the dialog automatically:​+**Example**: ​Display ​a dialog and wait five seconds for the user to make a selection. If no selection is made, dismiss the dialog automatically:​
 <code csharp> <code csharp>
 public sealed partial class MainPage : Page public sealed partial class MainPage : Page
notes/uwp/messagedialog.txt · Last modified: 2016/08/16 by admin