本文整理汇总了C#中ContentDialog类的典型用法代码示例。如果您正苦于以下问题:C# ContentDialog类的具体用法?C# ContentDialog怎么用?C# ContentDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentDialog类属于命名空间,在下文中一共展示了ContentDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TeamOneName
private async void TeamOneName()
{
TextBox txtName = new TextBox();
Grid contentGrid = new Grid();
contentGrid.Children.Add(txtName);
ContentDialog nameDialog = new ContentDialog()
{
Title = "Enter Team One Name",
Content = contentGrid,
PrimaryButtonText = "Submit"
};
await nameDialog.ShowAsync();
if (txtName.Text!="") {
team1Name= txtName.Text;
}
else
{
team1Name = "Team One";
}
teamOneName.Text = team1Name;
}
开发者ID:Martinc94,项目名称:MobileAppsProject,代码行数:25,代码来源:GaaScore.xaml.cs
示例2: buttonConnect_Click
private async void buttonConnect_Click(object sender, RoutedEventArgs e)
{
if (!App.serialPort.IsConnected())
{
int selection = listbox1.SelectedIndex;
if (selection < 0) return;
await App.serialPort.Connect(selection);
if (!App.serialPort.IsConnected())
{
ContentDialog dialog = new ContentDialog();
dialog.Title = "Connection failed";
dialog.Content = "Try to select another device";
dialog.PrimaryButtonText = "OK";
await dialog.ShowAsync();
return;
}
App.ledStripController.Connect();
Frame.Navigate(typeof(ControlPage));
}
else
{
App.ledStripController.Disconnect();
App.serialPort.Disconnect();
}
// RefrashInterface();
}
开发者ID:derwish-pro,项目名称:Arduino-Led-Strip-Controller,代码行数:34,代码来源:ConnectPage.xaml.cs
示例3: ContentDialog_SecondaryButtonClick
private void ContentDialog_SecondaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
if ( Member.WillLogin || Member.IsLoggedIn )
{
args.Cancel = true;
}
}
开发者ID:tgckpg,项目名称:wenku10,代码行数:7,代码来源:Login.xaml.cs
示例4: StartRecognizing_Click
} // end void
private async void StartRecognizing_Click(object sender, RoutedEventArgs e)
{
// Create an instance of SpeechRecognizer.
var speechRecognizer = new Windows.Media.SpeechRecognition.SpeechRecognizer();
// Compile the dictation grammar by default.
await speechRecognizer.CompileConstraintsAsync();
// Start recognition.
Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = await speechRecognizer.RecognizeWithUIAsync();
ContentDialog notifyDelete = new ContentDialog()
{
Title = "Confirm delete?",
Content = speechRecognitionResult.Text,
PrimaryButtonText = "Save Note",
SecondaryButtonText = "Cancel"
};
ContentDialogResult result = await notifyDelete.ShowAsync();
if (result == ContentDialogResult.Primary)
{
tbNote.Text = speechRecognitionResult.Text;
}
else
{
// User pressed Cancel or the back arrow.
// Terms of use were not accepted.
}
// Do something with the recognition result.
//var messageDialog = new Windows.UI.Popups.MessageDialog(speechRecognitionResult.Text, "Text spoken");
//await messageDialog.ShowAsync();
} // end StartRecognizing_Click
开发者ID:AlbertMcLa,项目名称:Template10-sample,代码行数:35,代码来源:BlankPage1.xaml.cs
示例5: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
args.Cancel = true;
if ( Keys.SelectedItem == null )
{
StringResources stx = new StringResources();
ServerMessage.Text = "Please Select a key";
return;
}
string PubKey = RSA.SelectedItem.GenPublicKey();
string Remarks = RemarksInput.Text.Trim();
if ( string.IsNullOrEmpty( Remarks ) )
{
Remarks = RemarksPlaceholder;
}
RCache.POST(
Shared.ShRequest.Server
, Shared.ShRequest.PlaceRequest( Target, PubKey, BindItem.Id, Remarks )
, PlaceSuccess
, ( c, Id, ex ) => { Error( ex.Message ); }
, false
);
}
开发者ID:tgckpg,项目名称:wenku10,代码行数:27,代码来源:PlaceRequest.xaml.cs
示例6: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if(Windows.Storage.ApplicationData.Current.LocalSettings.Values.Any(m => m.Key.Equals("username")))
Windows.Storage.ApplicationData.Current.LocalSettings.Values.Remove("username");
Windows.Storage.ApplicationData.Current.LocalSettings.Values.Add(new KeyValuePair<string, object>("username", this.name.Text));
this.Username = this.name.Text;
}
开发者ID:hn-dotnet,项目名称:codeweek-chat,代码行数:7,代码来源:Settings.xaml.cs
示例7: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
Dokument.statusBean = (Model.Status)statusi.SelectedItem;
Dokument.vrstaDokumenta = (Model.VrstaDokumenta)vrsteDokumenata.SelectedItem;
Dokument.kreiran = DateTime.Now;
Dokument.istice = istice.Date.Date;
}
开发者ID:HumaMilisic,项目名称:MA-Baze_Phone,代码行数:7,代码来源:DocDetailPage.xaml.cs
示例8: OnDialogOpened
private void OnDialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
{
username.ClearValue(TextBox.TextProperty);
pwd.ClearValue(PasswordBox.PasswordProperty);
pwd2.ClearValue(PasswordBox.PasswordProperty);
msg.ClearValue(TextBlock.TextProperty);
}
开发者ID:forehalo,项目名称:UWP-dev,代码行数:7,代码来源:Page2.xaml.cs
示例9: Tela_PrimaryButtonClick
private async static void Tela_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
var tela = sender.Content as MyUserControl1;
var readDataa = await ReadWrite.readStringFromLocalFile("data");
Profile profile = JsonSerilizer.ToProfile(readDataa);
if (tela.passwordBoxSenha.Password == profile.Password)
{
}
else
{
var acessar = new MyUserControl1();
ContentDialog dialogo = new ContentDialog();
dialogo.PrimaryButtonText = "Войти";
dialogo.PrimaryButtonClick += Tela_PrimaryButtonClick;
dialogo.Content = acessar;
await dialogo.ShowAsync();
}
}
开发者ID:SuchGlasha,项目名称:CashManagerDGK,代码行数:31,代码来源:MyUserControl1.xaml.cs
示例10: ContentDialog_PrimaryButtonClick
/// <summary>
/// 确定
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
args.Cancel = true;
UpLoading.Visibility = Visibility.Visible;
IsPrimaryButtonEnabled = false;
object[] result = await UserService.AddWZ(WZUrl.Text, WZTitle.Text, WZTags.Text, WZSummary.Text);
if (result != null)
{
if ((bool)result[0])
{
Hide();
}
else
{
Tips.Text = result[1].ToString();
UpLoading.Visibility = Visibility.Collapsed;
IsPrimaryButtonEnabled = true;
}
}
else
{
Tips.Text = "操作失败!";
UpLoading.Visibility = Visibility.Collapsed;
IsPrimaryButtonEnabled = true;
}
}
开发者ID:BourbonShi,项目名称:CNBlogs.UWP,代码行数:31,代码来源:AddWZDialog.xaml.cs
示例11: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
args.Cancel = true;
DetectInputLogin();
Canceled = false;
}
开发者ID:tgckpg,项目名称:wenku10,代码行数:7,代码来源:Register.xaml.cs
示例12: CallWebApiAsync
async Task CallWebApiAsync()
{
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("http://forecastlabo2.azurewebsites.net/api/Forecast");
if (response.StatusCode == System.Net.HttpStatusCode.OK) {
string json = await response.Content.ReadAsStringAsync();
var forecasts = Newtonsoft.Json.JsonConvert.DeserializeObject<Forecasts[]>(json);
ForeCastListView.ItemsSource = forecasts;
}else
{
var dialog = new ContentDialog()
{
Title = "Ooooops",
MaxWidth = this.ActualWidth
};
var panel = new StackPanel();
panel.Children.Add(new TextBlock {
Text = "Une erreur s'est produite lors de la récupération des prévisions météo",
TextWrapping = TextWrapping.Wrap,
});
dialog.Content = panel;
await dialog.ShowAsync();
//try catch et appeler une méthode qui gère l'erreur
//recherche google mot clé UWP / WPF Universal App/ faire les recherches en anglais
}
}
开发者ID:ChachaIG,项目名称:appMeteo,代码行数:29,代码来源:MainPage.xaml.cs
示例13: SignInContentDialog_Closing
void SignInContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
// If sign in was successful, save or clear the user name based on the user choice.
if (this.Result == SignInResult.SignInOK)
{
if (saveUserNameCheckBox.IsChecked == true)
{
SaveUserName();
}
else
{
ClearUserName();
}
}
// If the user entered a name and checked or cleared the 'save user name' checkbox, then clicked the back arrow,
// confirm if it was their intention to save or clear the user name without signing in.
if (this.Result == SignInResult.Nothing && !string.IsNullOrEmpty(userNameTextBox.Text))
{
if (saveUserNameCheckBox.IsChecked == false)
{
args.Cancel = true;
FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["DiscardNameFlyout"]);
FlyoutBase.ShowAttachedFlyout(this);
}
else if (saveUserNameCheckBox.IsChecked == true && !string.IsNullOrEmpty(userNameTextBox.Text))
{
args.Cancel = true;
FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["SaveNameFlyout"]);
FlyoutBase.ShowAttachedFlyout(this);
}
}
}
开发者ID:mkoutlook,项目名称:uwp,代码行数:33,代码来源:CustomDialog.xaml.cs
示例14: CancelPreviousAndShowDialog
protected void CancelPreviousAndShowDialog(ContentDialog dialog)
{
if (previous == null)
previous = dialog;
CancelPreviousDialog();
LastDialogControl = dialog.ShowAsync();
}
开发者ID:patel-pragnesh,项目名称:PowerMonitor,代码行数:7,代码来源:BasePage.cs
示例15: buttonAddPerson_Click
private async void buttonAddPerson_Click(object sender, RoutedEventArgs e)
{
var dialog = new ContentDialog();
dialog.Title = "Add a person to your list";
dialog.Content = new TextBox();
dialog.PrimaryButtonText = "Add";
dialog.IsPrimaryButtonEnabled = true;
var result = await dialog.ShowAsync();
if (ContentDialogResult.Primary == result)
{
try
{
var textBox = (TextBox)dialog.Content;
string text = textBox.Text;
if (text != "")
{
Person person = new Person(text);
ListViewItem item = new ListViewItem
{
Content = person.Name,
Tag = person
};
listViewPerson.Items.Add(item);
person.Save();
}
}
catch (NullReferenceException)
{
}
}
}
开发者ID:yann510,项目名称:HolidayList,代码行数:31,代码来源:MainPage.xaml.cs
示例16: ContentDialog_PrimaryButtonClick
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
// Disable the primary button
IsPrimaryButtonEnabled = false;
// Force the dialog to stay open until the operation completes.
// We will call Hide() when the api calls are done.
args.Cancel = true;
try
{
// Change the passphrase
await KryptPadApi.ChangePassphraseAsync(OldPassphrase, NewPassphrase);
// Done
await DialogHelper.ShowMessageDialogAsync("Profile passphrase changed successfully.");
// Hide dialog
Hide();
}
catch (WarningException ex)
{
// Operation failed
await DialogHelper.ShowMessageDialogAsync(ex.Message);
}
catch (WebException ex)
{
// Operation failed
await DialogHelper.ShowMessageDialogAsync(ex.Message);
}
// Restore the button
IsPrimaryButtonEnabled = CanChangePassphrase;
}
开发者ID:NeptuneCenturyStudios,项目名称:KryptPad,代码行数:34,代码来源:ChangePassphraseDialog.xaml.cs
示例17: OnDialogClosing
private void OnDialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
bool isChecked = true;
if (username.Text == "")
{
msg.Text = "请输入用户名。";
isChecked = false;
}
if (pwd.Password == "" || pwd2.Password == "")
{
msg.Text = "请输入密码。";
isChecked = false;
}
if (pwd.Password != pwd2.Password)
{
msg.Text = "两次输入的密码不一致。";
isChecked = false;
}
if(args.Result == ContentDialogResult.Primary)
{
args.Cancel = !isChecked;
}
}
开发者ID:forehalo,项目名称:UWP-dev,代码行数:25,代码来源:Page2.xaml.cs
示例18: showDialog
private async void showDialog()
{
dialog = new ContentDialog()
{
Title = "Authenticeren met de Hue Bridge",
MaxWidth = this.ActualWidth,
Background = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xff, 0xff))
};
var panel = new StackPanel();
panel.Children.Add(new TextBlock
{
Text = "Druk op de link knop op uw Hue bridge om verbinding te maken.",
TextWrapping = TextWrapping.Wrap
});
BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/smartbridge.jpg"));
panel.Children.Add(new Image
{
Source = bitmapImage
});
dialog.Content = panel;
var result = await dialog.ShowAsync();
}
开发者ID:Intrexion,项目名称:UWP-Hue,代码行数:27,代码来源:ListPage.xaml.cs
示例19: button_Click
private async void button_Click(object sender, RoutedEventArgs e)
{
if (MapControl1.IsStreetsideSupported)
{
BasicGeoposition cityPosition = new BasicGeoposition() { Latitude = 48.858, Longitude = 2.295 };
Geopoint cityCenter = new Geopoint(cityPosition);
StreetsidePanorama panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(cityCenter);
if (panoramaNearCity != null)
{
StreetsideExperience ssView = new StreetsideExperience(panoramaNearCity);
ssView.OverviewMapVisible = true;
MapControl1.CustomExperience = ssView;
}
}
else
{
ContentDialog viewNotSupportedDialog = new ContentDialog()
{
Title = "Streetside is not supported",
Content = "\nStreetside views are not supported on this device.",
PrimaryButtonText = "OK"
};
await viewNotSupportedDialog.ShowAsync();
}
}
开发者ID:myCodePixel,项目名称:blogsamples,代码行数:32,代码来源:MainPage.xaml.cs
示例20: ShowNoAccessDialog
public async void ShowNoAccessDialog() {
AccessStatus = await RequestAccess();
if (AccessStatus == GeolocationAccessStatus.Allowed) {
return;
}
TextBlock content = new TextBlock {
Text = "ERROR_NO_LOCTION_ACCESS_DisplayMessage".t(R.File.CORTANA),
TextAlignment = Windows.UI.Xaml.TextAlignment.Center,
Margin = new Windows.UI.Xaml.Thickness { Bottom = 10, Left = 10, Top = 10, Right = 10},
TextWrapping = Windows.UI.Xaml.TextWrapping.WrapWholeWords,
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center,
};
ContentDialog dialog = new ContentDialog() {
Content = content
};
dialog.SecondaryButtonText = "DIALOG_NO_LOCATION_ACCESS_CANCEL".t();
dialog.PrimaryButtonText = "DIALOG_NO_LOCATION_ACCESS_SETTINGS_BUTTON_TEXT".t();
dialog.PrimaryButtonClick += (d, _) => {
ShowLocationSettingsPage().Forget();
};
await dialog.ShowAsync();
}
开发者ID:Vedolin,项目名称:wheelmap-windows-app,代码行数:25,代码来源:LocationManager.cs
注:本文中的ContentDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论