public async void Run(IBackgroundTaskInstance taskInstance) { var def = taskInstance.GetDeferral(); try { Data.data = Set.JsonToArray <Data>(await Get.Read_Data_To_String())[0]; Year.Set(); if (Memory.Live_Tile) { LiveTile.Update(); } else { LiveTile.Reset(); } Set.Group_Notifications(2, 0, false); } finally { def.Complete(); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { loader.IsActive = true; Application.Current.Resuming += (s, ar) => { try { if (Memory.Live_Tile) { LiveTile.Update(); /* Update / reset live tile */ } else { LiveTile.Reset(); } Header_Set(); Body_Set(); } catch { } }; var cmp = Windows.Devices.Sensors.Compass.GetDefault(); if (cmp == null) { Compass_Btn.Visibility = Visibility.Collapsed; } else { Compass_Btn.Visibility = Visibility.Visible; } if (Memory.Live_Tile) { LiveTile.Update(); /* Update / reset live tile */ } else { LiveTile.Reset(); } DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += new TypedEventHandler <DataTransferManager, DataRequestedEventArgs>(this.ShareTextHandler); HardwareButtons.BackPressed += HardwareButtons_BackPressed; Header_Set(); Body_Set(); if (MainPage.firstUpad) //ako ulazi u app postavi grupne notifijacije { await Task.Delay(1600); MainPage.firstUpad = false; Set.Group_Notifications(2, 0, false); } }
private void livetile_TS_Toggled(object sender, RoutedEventArgs e) { if (ucitavam) { return; } Memory.Live_Tile = livetile_TS.IsOn; if (Memory.Live_Tile) { LiveTile.Update(); } else { LiveTile.Reset(); } Postavi_Stranicu(); }
/// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); try { if (Memory.Live_Tile) /// Update / reset live tile { LiveTile.Update(); } else { LiveTile.Reset(); } Set.Group_Notifications(2, 0, false); } finally { deferral.Complete(); } }