Пример #1
0
        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);
        }
Пример #2
0
        // 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();
        }
Пример #3
0
        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];
            }
        }
Пример #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            MyWearableHelpers.RegisterBackgroundTask();
        }