本文整理匯總了C#中Windows.UI.Popups.MessageDialog.ShowAsyncQueue方法的典型用法代碼示例。如果您正苦於以下問題:C# MessageDialog.ShowAsyncQueue方法的具體用法?C# MessageDialog.ShowAsyncQueue怎麽用?C# MessageDialog.ShowAsyncQueue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Windows.UI.Popups.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.ShowAsyncQueue方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShowAsyncQueueButton_OnClick
private void ShowAsyncQueueButton_OnClick(object sender, RoutedEventArgs e)
{
var dialog = new MessageDialog("Dialog 1 ShowAsyncQueue", "Dialog 1");
dialog.ShowAsyncQueue();
dialog = new MessageDialog("Dialog 2 ShowAsyncQueue", "Dialog 2");
dialog.ShowAsyncQueue();
dialog = new MessageDialog("Dialog 3 ShowAsyncQueue", "Dialog 3");
dialog.ShowAsyncQueue();
}
示例2: ShowAsyncQueueButton_OnClick
private void ShowAsyncQueueButton_OnClick(object sender, RoutedEventArgs e)
{
var dialog = new MessageDialog("Dialog 1 ShowAsyncQueue", "Dialog 1");
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
dialog.ShowAsyncQueue();
dialog = new MessageDialog("Dialog 2 ShowAsyncQueue", "Dialog 2");
dialog.ShowAsyncQueue();
dialog = new MessageDialog("Dialog 3 ShowAsyncQueue", "Dialog 3");
dialog.ShowAsyncQueue();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
}
示例3: HandleException
public static async Task HandleException()
{
var dialog = new MessageDialog("Something went wrong and app may be unstable now. Do you want to logout and try again?");
dialog.Commands.Add(new UICommand("Yes") { Id = 0 });
dialog.Commands.Add(new UICommand("No") { Id = 1 });
dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;
var result = await dialog.ShowAsyncQueue();
if ((int)result.Id == 0)
{
GameClient.DoLogout();
BootStrapper.Current.NavigationService.Navigate(typeof(MainPage));
}
}
示例4: HandleException
public static async Task HandleException()
{
var dialog = new MessageDialog(Resources.Translation.GetString("SomethingWentWrong"));
dialog.Commands.Add(new UICommand(Resources.Translation.GetString("Yes")) { Id = 0 });
dialog.Commands.Add(new UICommand(Resources.Translation.GetString("No")) { Id = 1 });
dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;
var result = await dialog.ShowAsyncQueue();
if ((int)result.Id == 0)
{
GameClient.DoLogout();
BootStrapper.Current.NavigationService.Navigate(typeof(MainPage));
}
}
示例5: ShowAsyncQueuePlusIfPossibleButton_OnClick
private async void ShowAsyncQueuePlusIfPossibleButton_OnClick(object sender, RoutedEventArgs e)
{
// This should obviously be displayed
var dialog = new MessageDialog("await ShowAsync", "Dialog 1");
await dialog.ShowAsync();
// This should be displayed because we awaited the previous request to return
dialog = new MessageDialog("await ShowAsync", "Dialog 2");
await dialog.ShowAsync();
// All other requests below are invoked without awaiting
// the preceding ones to complete (dialogs being closed)
// This will show because there is no dialog shown at this time
dialog = new MessageDialog("ShowAsyncIfPossible", "Dialog 3");
#pragma warning disable 4014
dialog.ShowAsyncIfPossible();
// This will not show because there is a dialog shown at this time
dialog = new MessageDialog("ShowAsyncIfPossible", "Dialog 4");
dialog.ShowAsyncIfPossible();
// This will show after Dialog 3 is dismissed
dialog = new MessageDialog("ShowAsyncQueue", "Dialog 5");
dialog.ShowAsyncQueue();
// This will not show because there is a dialog shown at this time (Dialog 3)
dialog = new MessageDialog("ShowAsyncIfPossible", "Dialog 6");
dialog.ShowAsyncIfPossible();
// This will show after Dialog 5 is dismissed
dialog = new MessageDialog("ShowAsyncQueue", "Dialog 7");
dialog.ShowAsyncQueue();
// This will show after Dialog 7 is dismissed
dialog = new MessageDialog("ShowAsyncQueue", "Dialog 8");
dialog.ShowAsyncQueue();
#pragma warning restore 4014
}
示例6: OnStartAsync
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
var hasPreviousSession = !string.IsNullOrEmpty(SettingsService.Instance.PtcAuthToken) ||
!string.IsNullOrEmpty(SettingsService.Instance.GoogleAuthToken);
if (hasPreviousSession)
{
try
{
await GameClient.InitializeClient(!string.IsNullOrEmpty(SettingsService.Instance.PtcAuthToken));
// We have a stored token, let's go to game page
NavigationService.Navigate(typeof(GameMapPage), true);
//await ViewModelLocator.GameManagerViewModel.InitGame(true);
}
catch (Exception)
{
await ExceptionHandler.HandleException();
}
}
else
{
await NavigationService.NavigateAsync(typeof(MainPage));
}
// Check for updates
var latestVersionUri = await UpdateManager.IsUpdateAvailable();
if (latestVersionUri != null)
{
var dialog = new MessageDialog(
$"An updated version is available on\n{latestVersionUri}\nDo you want to visit the link?");
dialog.Commands.Add(new UICommand("Yes") { Id = 0 });
dialog.Commands.Add(new UICommand("No") { Id = 1 });
dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;
var result = await dialog.ShowAsyncQueue();
if ((int) result.Id != 0) return;
await Launcher.LaunchUriAsync(new Uri(latestVersionUri));
}
await Task.CompletedTask;
}
示例7: networkListenerService_InternetConnectionChanged
async void networkListenerService_InternetConnectionChanged(object sender, Model.Events.InternetConnectionChangedEventArgs e)
{
await App.Dispatcher?.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
IsInternet = e.IsConnected;
if (!IsInternet)
{
if (Locator.MediaPlaybackViewModel?.IsPlaying == true && Locator.MediaPlaybackViewModel.IsStream)
{
var lostStreamDialog = new MessageDialog("Connection to the server was stopped, please check your Internet connection");
await lostStreamDialog.ShowAsyncQueue();
}
}
});
}
示例8: _mediaService_MediaFailed
async void _mediaService_MediaFailed(object sender, EventArgs e)
{
if (sender is MFService)
{
// MediaFoundation failed to open the media, switching to VLC player
await SetMedia(CurrentMedia, true);
}
else
{
await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
var md = new MessageDialog("Your media cannot be read.", "We're sorry");
await md.ShowAsyncQueue();
// ensure we call Stop so we unregister all events
Stop();
});
}
}
示例9: locator_StatusChanged
/// <summary>
/// Je možné, že vyhodí chybu.
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void locator_StatusChanged(Geolocator sender, StatusChangedEventArgs args)
{
string s;
s = _localSettings.Containers["AppSettings"].Values["lastNearestStation"].ToString();
//Získání stavu
var a = sender.LocationStatus.ToString();
switch (sender.LocationStatus)
{
case Windows.Devices.Geolocation.PositionStatus.Disabled:
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
//await msgGPSDisabled();
MessageDialog sss = new MessageDialog(_resourceLoader.GetString("MsgGPSDisabled"),_resourceLoader.GetString("Error"));
await sss.ShowAsyncQueue();
IsGPSBusy = false;
IsGPS = false;
App.ViewModel.GPSStatus = GPSSTATUS.GPSdisabled.ToString();
});
if (s != null)
{
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
App.ViewModel.CurrentStation = App.ViewModel.GetStation(s);
});
}
break;
case Windows.Devices.Geolocation.PositionStatus.NoData:
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
MessageDialog sss = new MessageDialog(_resourceLoader.GetString("MsgGPSUnavailable"), _resourceLoader.GetString("Error"));
await sss.ShowAsyncQueue();
IsGPSBusy = false;
IsGPS = false;
App.ViewModel.GPSStatus = GPSSTATUS.GPSnotactive.ToString();
});
if (s != null) App.ViewModel.CurrentStation = App.ViewModel.GetStation(s);
break;
case Windows.Devices.Geolocation.PositionStatus.Ready:
var nearestStation = true;
object tmpObject = null;
Windows.Storage.ApplicationData.Current.LocalSettings.Containers["AppSettings"].Values.TryGetValue("nearestStation", out tmpObject);
bool? x = tmpObject as bool?;
if (x != null)
{
nearestStation = x.Value;
}
if (nearestStation)
{
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
App.ViewModel.GPSStatus = GPSSTATUS.GPSactive.ToString();
});
}
break;
}
}