private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { bool ssl = (CheckSSL.IsChecked == true) ? true : false; var roamingSettings = ApplicationData.Current.RoamingSettings; MyWearableHelpers.SaveSettings(AddressBox.Text, ServerBox.Text, int.Parse(PortBox.Text), ssl, UsernameBox.Text, PassBox.Password); }
// https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/notification-listener protected override async void OnBackgroundActivated(BackgroundActivatedEventArgs args) { var deferral = args.TaskInstance.GetDeferral(); switch (args.TaskInstance.Task.Name) { case "UserNotificationChanged": // Call your own method to process the new/removed notifications // The next section of documentation discusses this code await MyWearableHelpers.SyncNotifications(); break; } deferral.Complete(); }
public SettingDialog() { this.InitializeComponent(); string settings = MyWearableHelpers.LoadSettings(); if (settings != null) { string[] setting = settings.Split(';'); AddressBox.Text = setting[0]; ServerBox.Text = setting[1]; PortBox.Text = setting[2]; CheckSSL.IsChecked = (setting[3] == "1") ? true : false; UsernameBox.Text = setting[4]; PassBox.Password = setting[5]; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); MyWearableHelpers.RegisterBackgroundTask(); }