Beispiel #1
0
        private void TileIntervalUpdate_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!TileTaskSwitch.IsOn)
            {
                return;
            }

            BackgroundTasks.UnregisterPrimaryTileTask();
            BackgroundTasks.RegisterPrimaryTileTask(GetTileIntervalUpdate());
        }
Beispiel #2
0
        /// <summary>
        /// Add or remove background task when the toggle changes state
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TileTaskSwitch_Toggled(object sender, RoutedEventArgs e)
        {
            var toggle = (ToggleSwitch)sender;

            if (toggle.IsOn)
            {
                ShowTileTaskActivity();
                UpdateTileTaskActivityText();

                if (BackgroundTasks.IsPrimaryTaskActivated())
                {
                    return;
                }

                BackgroundTasks.RegisterPrimaryTileTask(GetTileIntervalUpdate());
                UpdatePrimaryTaskType();
            }
            else
            {
                BackgroundTasks.UnregisterPrimaryTileTask();
                HideTileTaskAcitvity();
            }
        }
Beispiel #3
0
 private void RestartTileTask_Tapped(object sender, TappedRoutedEventArgs e)
 {
     BackgroundTasks.UnregisterPrimaryTileTask();
     BackgroundTasks.RegisterPrimaryTileTask(GetTileIntervalUpdate());
 }