Exemplo n.º 1
0
        private void InitialPage_LayoutUpdated(object sender, EventArgs e)
        {
            this.LayoutUpdated -= InitialPage_LayoutUpdated;

            if (ConsentManager.HasConsented)
            {
                if (!(App.Current as App).JustLoggedOut)
                {
                    TombstoneData data = TombstoneManager.Load();
                    if (data != null)
                    {
                        TinderSession activeSession = TinderSession.FromTombstoneData(data);
                        (App.Current as App).RightSideBar.DataContext = activeSession.Matches;

                        TopBarViewModel.ShowTopButtons = System.Windows.Visibility.Visible;

                        NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

                        App.RootFrame.RemoveBackEntry();

                        return;
                    }
                }
                else
                {
                    LoginButtonBorder.Visibility = System.Windows.Visibility.Visible;
                }
            }

            if (!(App.Current as App).JustLoggedOut)
            {
                Open.Begin();
            }
        }
Exemplo n.º 2
0
 private void PhoneApplicationService_Deactivated(object sender, Microsoft.Phone.Shell.DeactivatedEventArgs e)
 {
     if (TinderSession.CurrentSession.IsAuthenticated)
     {
         TombstoneManager.Save(TinderSession.CurrentSession.ToTombstoneData());
     }
 }
Exemplo n.º 3
0
 private void PhoneApplicationService_Activated(object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
 {
     if (!e.IsApplicationInstancePreserved)
     {
         TombstoneData data = TombstoneManager.Load();
         if (data != null)
         {
             TinderSession.FromTombstoneData(data);
         }
     }
 }
Exemplo n.º 4
0
 public void Logout()
 {
     JustLoggedOut = true;
     Client.StopAllRequests();
     TinderSession.CurrentSession.Logout();
     TombstoneManager.Delete();
     RootFrame.ViewModel.TopBarVisible = false;
     RootFrameInstance.Navigate(new Uri("/InitialPage.xaml", UriKind.Relative));
     while (RootFrameInstance.CanGoBack)
     {
         RootFrameInstance.RemoveBackEntry();
     }
 }