Esempio n. 1
0
 private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("LeavingBackground");
     _isInBackgroundMode = false;
     MemoryManager.AppMemoryUsageIncreased     -= OnMemoryIncreased;
     MemoryManager.AppMemoryUsageLimitChanging -= OnMemoryLimitChanged;
     if (_isMusicBoardBeShutDown)   // REBUILD MUSIC BOARD
     {
         _isMusicBoardBeShutDown = false;
         AppResources.NavigateToBase?.Invoke(
             null,
             AppResources.MusicIsCurrent,
             AppResources.GetFrameInstance(FrameType.UpContent),
             AppResources.GetPageType(NavigateType.MusicBoard));
     }
 }
Esempio n. 2
0
 protected override void OnActivated(IActivatedEventArgs args)
 {
     RegisterExceptionHandlingSynchronizationContext();
     if (args.Kind == ActivationKind.ToastNotification)
     {
         var toastArgs = args as ToastNotificationActivatedEventArgs;
         FromToastArgument = toastArgs.Argument;
         Frame root = Window.Current.Content as Frame;
         if (root == null)
         {
             root = new Frame();
             Window.Current.Content = root;
         }
         if (root.Content == null)
         {
             root.Navigate(typeof(MainPage), toastArgs);
         }
         else
         {
             try {
                 var decode = JsonHelper.FromJson <ToastParameters>(FromToastArgument);
                 if (decode != null)
                 {
                     AppResources.NavigateToBase?.Invoke(
                         null,
                         new NavigateParameter {
                         ToUri           = new Uri(decode.Uri),
                         Title           = decode.Title,
                         IsFromInfoClick = true,
                         IsNative        = true,
                         FrameType       = FrameType.Content
                     },
                         AppResources.GetFrameInstance(FrameType.Content),
                         AppResources.GetPageType(NavigateType.ItemClickNative));
                 }
             } catch { /* I do not want my app to be shut down. */ }
         }
         Window.Current.Activate();
     }
 }