本文整理汇总了C#中Windows.UI.Popups.MessageDialog类的典型用法代码示例。如果您正苦于以下问题:C# Windows.UI.Popups.MessageDialog类的具体用法?C# Windows.UI.Popups.MessageDialog怎么用?C# Windows.UI.Popups.MessageDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Windows.UI.Popups.MessageDialog类属于命名空间,在下文中一共展示了Windows.UI.Popups.MessageDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
drug = e.Parameter as string;
Windows.UI.Popups.MessageDialog m = new Windows.UI.Popups.MessageDialog("what is this: " + drug);
m.ShowAsync();
}
开发者ID:Maast3r,项目名称:Epic-BoilerMake,代码行数:7,代码来源:BlankPage2.xaml.cs
示例2: MainPage_Loaded
private async void MainPage_Loaded(object sender, RoutedEventArgs e)
{
SetupPersonGroup();
dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
bool permissionGained = await RequestMicrophonePermission();
if (!permissionGained)
return; // No permission granted
Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
string langTag = speechLanguage.LanguageTag;
speechContext = ResourceContext.GetForCurrentView();
speechContext.Languages = new string[] { langTag };
speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");
await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
try
{
await speechRecognizer.ContinuousRecognitionSession.StartAsync();
}
catch (Exception ex)
{
var messageDialog = new Windows.UI.Popups.MessageDialog(ex.Message, "Exception");
await messageDialog.ShowAsync();
}
}
开发者ID:liliankasem,项目名称:ProjectSpike,代码行数:30,代码来源:MainPage.xaml.cs
示例3: GetUserRoles
public static async Task GetUserRoles(ObservableCollection<UserRole> UserRoleList)
{
var response = await http.GetAsync("http://uwproject.feifei.ca/api/ApplicationRoles");
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadAsStringAsync();
JsonValue value = JsonValue.Parse(result);
JsonArray root = value.GetArray();
for (uint i = 0; i < root.Count; i++)
{
string id = root.GetObjectAt(i).GetNamedString("Id");
string name = root.GetObjectAt(i).GetNamedString("Name");
var userRole = new UserRole
{
Id = id,
Name = name
};
UserRoleList.Add(userRole);
}
}
else
{
var dialog = new Windows.UI.Popups.MessageDialog("Cannot retrieve any record");
await dialog.ShowAsync();
}
}
开发者ID:Guanyi,项目名称:UWPDiplomaOptions,代码行数:27,代码来源:UserRole.cs
示例4: getRemainingUsefullLife
public async void getRemainingUsefullLife()
{
try
{
List<string> QList = new List<string>();
List<Double> TList = new List<Double>();
var q = from allgroupname in ParseObject.GetQuery("RemainingUsefulLife")
where allgroupname.Get<string>("EquipmentName") != ""
select allgroupname;
var f = await q.FindAsync();
foreach (var obj in f)
{
QList.Add(obj.Get<String>("EquipmentName"));
TList.Add(obj.Get<Double>("TTL"));
EquipmentNamelistView.ItemsSource = QList;
TTLlistView.ItemsSource = TList;
}
}
catch (Exception ex)
{
Windows.UI.Popups.MessageDialog md = new Windows.UI.Popups.MessageDialog(ex.Message);
md.ShowAsync();
}
}
开发者ID:gsg-business-innovation-lab,项目名称:Field_Intelligence,代码行数:35,代码来源:RemainingUsefulLifeWeek.xaml.cs
示例5: CreateButton_Click
private async void CreateButton_Click(object sender, RoutedEventArgs e)
{
if (!App.HasConnectivity)
{
var messageDialog = new Windows.UI.Popups.MessageDialog("You can't create a Read it Later account until you have Internet access. Please try again once you're connected to the Internet.", "Error");
await messageDialog.ShowAsync();
return;
}
if (!string.IsNullOrWhiteSpace(passwordPasswordBox.Password) &&
!string.IsNullOrWhiteSpace(usernameTextBox.Text))
{
var username = usernameTextBox.Text;
var password = passwordPasswordBox.Password;
var api = new ReadItLaterApi.Metro.ReadItLaterApi(username, password);
if (await api.CreateAccount())
{
SaveSettings(usernameTextBox.Text.Trim(), passwordPasswordBox.Password);
Hide();
}
else
{
var messageDialog = new Windows.UI.Popups.MessageDialog("There was an error creating your Read it Later account. Please try again later.", "Error");
await messageDialog.ShowAsync();
}
}
}
开发者ID:beaugunderson,项目名称:EasyReader,代码行数:33,代码来源:SettingsUserControl.xaml.cs
示例6: saveEditRecordatorio
private async void saveEditRecordatorio(object sender, RoutedEventArgs e)
{
if (validarDatos() == 1) //campos validados
{
fact.Alarma = getFechaAlarma();
fact.Estado = "Pendiente";
fact.Valor = Convert.ToInt32(txtValor.Text);
factDao.updateFactura(fact); //actualizo el objeto en la base de datos, y se actualiza en la coleccion de objetos
//redirijo a la MainPage
rootFrame.Navigate(typeof(MainPage), "1");
}
if (validarDatos() == 2) //problemas con la fecha
{
var dialog = new Windows.UI.Popups.MessageDialog("No te podemos notificar " + (txtDia.SelectedIndex + 1) + " días antes, el día límite es el " + txtVence.Text, "Algo sucede!");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("Entendido") { Id = 1 });
var result = await dialog.ShowAsync();
}
if (validarDatos() == 0)
{
var dialog = new Windows.UI.Popups.MessageDialog("Falta información para crear el recordatorio", "Falta Información!");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("Entendido") { Id = 1 });
var result = await dialog.ShowAsync();
}
}
开发者ID:dapintounicauca,项目名称:AppFacturas,代码行数:27,代码来源:editFacturaPage.xaml.cs
示例7: cambiarMiInfo
private async void cambiarMiInfo(object sender, RoutedEventArgs e)
{
Esperar1.Visibility = Visibility.Visible;
try
{
var trata = new ParseObject("User");
trata.ObjectId = usu.Id;
trata["Nombre"] = nombre.Text;
trata["Apellido"] = apellido.Text;
trata["email"] = correo.Text;
trata["telefono"] = int.Parse(telefono.Text);
trata["cedula"] = cedula.Text;
trata["username"] = username.Text;
trata["password"] = password.Password;
usu.Nombre = nombre.Text;
usu.Apellido = apellido.Text;
usu.Correo = correo.Text;
usu.Telefono = uint.Parse(telefono.Text);
usu.Cedula = cedula.Text;
usu.Username = username.Text;
usu.Password = password.Password;
await trata.SaveAsync();
Esperar1.Visibility = Visibility.Collapsed;
}
catch (Exception ex)
{
Esperar1.Visibility = Visibility.Collapsed;
var dialog = new Windows.UI.Popups.MessageDialog("Tu información no ha podido ser editada");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("OK") { });
var result = await dialog.ShowAsync();
}
}
开发者ID:davidguzman1693,项目名称:W10TreatSelf,代码行数:34,代码来源:MiInformacion.xaml.cs
示例8: OnTargetFileRequested
private async void OnTargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs e)
{
// This scenario demonstrates how the app can go about handling the TargetFileRequested event on the UI thread, from
// which the app can manipulate the UI, show error dialogs, etc.
// Requesting a deferral allows the app to return from this event handler and complete the request at a later time.
// In this case, the deferral is required as the app intends on handling the TargetFileRequested event on the UI thread.
// Note that the deferral can be requested more than once but calling Complete on the deferral a single time will complete
// original TargetFileRequested event.
var deferral = e.Request.GetDeferral();
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
// This method will be called on the app's UI thread, which allows for actions like manipulating
// the UI or showing error dialogs
// Display a dialog indicating to the user that a corrective action needs to occur
var errorDialog = new Windows.UI.Popups.MessageDialog("If the app needs the user to correct a problem before the app can save the file, the app can use a message like this to tell the user about the problem and how to correct it.");
await errorDialog.ShowAsync();
// Set the targetFile property to null and complete the deferral to indicate failure once the user has closed the
// dialog. This will allow the user to take any neccessary corrective action and click the Save button once again.
e.Request.TargetFile = null;
deferral.Complete();
});
}
开发者ID:mbin,项目名称:Win81App,代码行数:26,代码来源:FileSavePicker_FailToSave.xaml.cs
示例9: SaveButton_Click
private async void SaveButton_Click(object sender, RoutedEventArgs e)
{
FileSavePicker savePicker = new FileSavePicker();
savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
// Dropdown of file types the user can save the file as
savePicker.FileTypeChoices.Add("Rich Text", new List<string>() { ".rtf" });
// Default file name if the user does not type one in or select a file to replace
savePicker.SuggestedFileName = "New Document";
StorageFile file = await savePicker.PickSaveFileAsync();
if (file != null)
{
// Prevent updates to the remote version of the file until we
// finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(file);
// write to file
using (Windows.Storage.Streams.IRandomAccessStream randAccStream =
await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite))
{
editor.Document.SaveToStream(Windows.UI.Text.TextGetOptions.FormatRtf, randAccStream);
}
// Let Windows know that we're finished changing the file so the
// other app can update the remote version of the file.
FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file);
if (status != FileUpdateStatus.Complete)
{
Windows.UI.Popups.MessageDialog errorBox =
new Windows.UI.Popups.MessageDialog("File " + file.Name + " couldn't be saved.");
await errorBox.ShowAsync();
}
}
}
开发者ID:C-C-D-I,项目名称:Windows-universal-samples,代码行数:35,代码来源:RichEditBoxPage.xaml.cs
示例10: GetActiveOptions
public static async Task GetActiveOptions(ObservableCollection<Option> OptionsList)
{
var response = await http.GetAsync("http://uwproject.feifei.ca/api/Options");
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadAsStringAsync();
JsonValue value = JsonValue.Parse(result);
JsonArray root = value.GetArray();
for (uint i = 0; i < root.Count; i++)
{
int optionId = (int)root.GetObjectAt(i).GetNamedNumber("OptionId");
string title = root.GetObjectAt(i).GetNamedString("Title");
bool isActive = root.GetObjectAt(i).GetNamedBoolean("IsActive");
if (isActive == true)
{
var option = new Option
{
OptionId = optionId,
Title = title,
IsActive = isActive,
};
OptionsList.Add(option);
}
}
}
else
{
var dialog = new Windows.UI.Popups.MessageDialog("Cannot retrieve any record");
await dialog.ShowAsync();
}
}
开发者ID:Guanyi,项目名称:UWPDiplomaOptions,代码行数:32,代码来源:Option.cs
示例11: BookReseravation_Click
private async void BookReseravation_Click(Book book)
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
string strVR = loader.GetString("ValideReservation");
string yes = loader.GetString("Yes");
string no = loader.GetString("No");
var dialog = new Windows.UI.Popups.MessageDialog(book.Title+"\n" + strVR);
dialog.Commands.Add(new Windows.UI.Popups.UICommand(yes) { Id = 1 });
dialog.Commands.Add(new Windows.UI.Popups.UICommand(no) { Id = 0 });
var result = await dialog.ShowAsync();
if ((int)result.Id == 1)
{
var duplicate = false;
foreach (var b in bookReservation)
{
if (b.NumBook == book.NumBook)
duplicate = true;
}
if(duplicate == false)
bookReservation.Add(book);
else
{
var str = loader.GetString("Duplicate");
dialog = new Windows.UI.Popups.MessageDialog(str);
await dialog.ShowAsync();
}
}
}
开发者ID:catrubens,项目名称:Henallux,代码行数:30,代码来源:MainViewModel.cs
示例12: CaptureImage
public async void CaptureImage()
{
var dialog = new Windows.UI.Popups.MessageDialog("Would you like to use your camera or select a picture from your library?");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("I'd like to use my camera", null, "camera"));
dialog.Commands.Add(new Windows.UI.Popups.UICommand("I already have the picture", null, "picker"));
IStorageFile photoFile;
var command = await dialog.ShowAsync();
if ((string) command.Id == "camera")
{
var cameraCapture = new Windows.Media.Capture.CameraCaptureUI();
photoFile = await cameraCapture.CaptureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.Photo);
}
else
{
var photoPicker = new FileOpenPicker();
photoPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
photoPicker.FileTypeFilter.Add(".png");
photoPicker.FileTypeFilter.Add(".jpg");
photoPicker.FileTypeFilter.Add(".jpeg");
photoFile = await photoPicker.PickSingleFileAsync();
}
if (photoFile == null)
return;
var raStream = await photoFile.OpenAsync(FileAccessMode.Read);
Customer.ImageStream = raStream.AsStream();
}
开发者ID:bendewey,项目名称:LeadPro,代码行数:30,代码来源:EditCustomerViewModel.cs
示例13: GetYearTerms
public static async Task GetYearTerms(ObservableCollection<YearTerm> YearTermsList)
{
var response = await http.GetAsync("http://uwproject.feifei.ca/api/YearTerms");
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadAsStringAsync();
JsonValue value = JsonValue.Parse(result);
JsonArray root = value.GetArray();
for (uint i = 0; i < root.Count; i++)
{
int yearTermId = (int)root.GetObjectAt(i).GetNamedNumber("YearTermId");
int year = (int)root.GetObjectAt(i).GetNamedNumber("Year");
int term = (int)root.GetObjectAt(i).GetNamedNumber("Term");
bool isDefault = root.GetObjectAt(i).GetNamedBoolean("IsDefault");
string description = root.GetObjectAt(i).GetNamedString("Description");
var yearTerm = new YearTerm
{
YearTermId = yearTermId,
Year = year,
Term = term,
IsDefault = isDefault,
};
YearTermsList.Add(yearTerm);
}
}
else
{
var dialog = new Windows.UI.Popups.MessageDialog("Cannot retrieve any record");
await dialog.ShowAsync();
}
}
开发者ID:Guanyi,项目名称:UWPDiplomaOptions,代码行数:32,代码来源:YearTerm.cs
示例14: getPredictFailure
public async void getPredictFailure()
{
try
{
List<string> QList = new List<string>();
List<Double> FList = new List<Double>();
var q = ParseObject.GetQuery("FailureNextWeek");
// where allgroupname.Get<string>("EquipmentName") != ""
// select allgroupname;
var f = await q.FindAsync();
foreach (var obj in f)
{
QList.Add(obj.Get<String>("EquipmentName"));
FList.Add(obj.Get<Double>("FailureProbability"));
EquipmentNamelistView.ItemsSource = QList;
FPlistView.ItemsSource = FList;
}
}
catch (Exception ex)
{
Windows.UI.Popups.MessageDialog md = new Windows.UI.Popups.MessageDialog(ex.Message);
md.ShowAsync();
}
}
开发者ID:gsg-business-innovation-lab,项目名称:Field_Intelligence,代码行数:35,代码来源:PredictedFailure.xaml.cs
示例15: button_Click
private async void button_Click(object sender, RoutedEventArgs e)
{
pickedContact = null;
var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker();
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
var contact = await contactPicker.PickContactAsync();
if (contact != null)
{
string msg = "Got contact " + contact.DisplayName + " with phone numbers: ";
foreach (var phone in contact.Phones)
{
msg += (phone.Kind.ToString() + " " + phone.Number);
}
var dlg = new Windows.UI.Popups.MessageDialog(msg);
await dlg.ShowAsync();
pickedContact = contact;
}
}
开发者ID:wkk91193,项目名称:rendezvous-mobile-4.0,代码行数:25,代码来源:ChatBox.xaml.cs
示例16: IsValid
private static async Task<bool> IsValid(OrderViewModel orderViewModel)
{
if (string.IsNullOrWhiteSpace(orderViewModel.Customer))
{
var messageBox = new Windows.UI.Popups.MessageDialog("You must specify a customer name.", "Warning!");
await messageBox.ShowAsync();
return false;
}
if (string.IsNullOrWhiteSpace(orderViewModel.SelectedProduct))
{
var messageBox = new Windows.UI.Popups.MessageDialog("You must select a product.", "Warning!");
await messageBox.ShowAsync();
return false;
}
if (orderViewModel.SelectedAmount == -1)
{
var messageBox = new Windows.UI.Popups.MessageDialog("You must select an amount.", "Warning!");
await messageBox.ShowAsync();
return false;
}
return true;
}
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:25,代码来源:MainPage.xaml.cs
示例17: saveRecordatorio
private async void saveRecordatorio(object sender, RoutedEventArgs e)
{
if (validarDatos() == 1) //si los datos son validados
{
Factura factura = new Factura();
factura = getInfoFactura(); //obtengo la infomacion de los controles y retonrno el objeto factura
factDao.insertFactura(factura); //inserto en la base de datos el nuevo objeto
var facturas = App.Current.Resources["facturas"] as Facturas; //obtengo la referencia de la coleccion de datos
facturas.Data.Add(factura); //actualizo la coleccion con el objeto que fue insertado en la base de datos
//redirigo a MainPage con bandera 0 para mensaje de insertado con exito
rootFrame.Navigate(typeof(MainPage), "0");
}
if (validarDatos() == 2) //problemas con la fecha
{
var dialog = new Windows.UI.Popups.MessageDialog("No te podemos notificar " + (txtDia.SelectedIndex + 1) + " días antes, el día límite es el " + txtVence.Text, "Algo sucede!");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("Entendido") { Id = 1 });
var result = await dialog.ShowAsync();
}
if (validarDatos() == 0)
{
var dialog = new Windows.UI.Popups.MessageDialog("Falta información para crear el recordatorio", "Falta Información!");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("Entendido") { Id = 1 });
var result = await dialog.ShowAsync();
}
}
开发者ID:dapintounicauca,项目名称:AppFacturas,代码行数:29,代码来源:AddFacturaPage.xaml.cs
示例18: AppBarButton_Click_Help
private async void AppBarButton_Click_Help(object sender, RoutedEventArgs e)
{
var message = new Windows.UI.Popups.MessageDialog("Tutaj będzie opis aplikacji w j.Angielskim", "Help"); // Będzie odwołanie do pliku resource
await message.ShowAsync();
message = null;
//Kliknięcie przycisku help, nawigacja do strony pomocy
}
开发者ID:Madpixel6,项目名称:Niewidomy,代码行数:7,代码来源:MainPage.xaml.cs
示例19: onClickSiguiente
private async void onClickSiguiente(object sender, RoutedEventArgs e)
{
this.nombre = nombrePlan.Text;
this.descripcion = descripcionPlan.Text;
this.fecha = fechaPlan.Date.Day + "/" + fechaPlan.Date.Month + "/" + fechaPlan.Date.Year;
this.hora = configurarHora(horaPlan.Time.Hours, horaPlan.Time.Minutes);
if (nombre.Equals("") && descripcion.Equals(""))
{
var dialog = new Windows.UI.Popups.MessageDialog("Por favor llene los campos");
dialog.Commands.Add(new Windows.UI.Popups.UICommand("OK") { Id = 0 });
var result = await dialog.ShowAsync();
}
else
{
if (photo == null)
{
var packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
var assetsFolder = await packageLocation.GetFolderAsync("Assets");
photo = await assetsFolder.GetFileAsync("fotoplan.jpg");
}
Plan plan = new Plan()
{
NombrePlan = nombre,
DescripcionPlan = descripcion,
FechaPlan = fecha,
HoraPlan = hora,
ImagenPlan = photo
};
Frame rootFrame = Window.Current.Content as Frame;
rootFrame.Navigate(typeof(AddMapa), plan);
}
}
开发者ID:simonbedoya,项目名称:PlansPop-W10,代码行数:35,代码来源:AgregarPlan.xaml.cs
示例20: Next_Click_1
private async void Next_Click_1(object sender, RoutedEventArgs e)
{
try
{
if (string.IsNullOrEmpty(txtDictTitle.Text))
throw new Exception("Please provide a dictionary title");
if (await similarDictionaryFileNameExists())
{
var dlg = new Windows.UI.Popups.MessageDialog("A dictionary titled '" + txtDictTitle.Text + "' already exists.\nPlease choose a different name");
await dlg.ShowAsync();
return;
}
// Go to the next stage where you can opt to import from text files
if (this.Frame != null)
{
this.Frame.Navigate(typeof(TextFileImport), txtDictTitle.Text);
}
}
catch (Exception ex)
{
if (this.Frame != null)
{
this.Frame.Navigate(typeof(MessagePopup), ex.Message);
}
}
}
开发者ID:MartinBjornebye,项目名称:Crammer,代码行数:28,代码来源:NewDictTitle.xaml.cs
注:本文中的Windows.UI.Popups.MessageDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论