Beispiel #1
0
		public async Task<DialogResult> ShowAsync(string message, Feature feature, DialogType? type = null)
		{
			if (message == null) throw new ArgumentNullException(nameof(message));
			if (feature == null) throw new ArgumentNullException(nameof(feature));

			var dialog = new MessageDialog(message);

			UICommandInvokedHandler empty = cmd => { };
			dialog.Commands.Add(new UICommand(@"Accept", empty, DialogResult.Accept));
			dialog.Commands.Add(new UICommand(@"Cancel", empty, DialogResult.Cancel));
			dialog.Commands.Add(new UICommand(@"Decline", empty, DialogResult.Decline));

			feature.Pause();

			var task = dialog.ShowAsync().AsTask();
			var result = await task;

			feature.Resume();
			return (DialogResult)result.Id;
		}