summaryrefslogtreecommitdiff
path: root/Juick/LoginView.xaml.cs
blob: 06ac58cd0d1d46aa1851401f6679cd1f30da7d9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Linq;
using System.Windows;
using Juick.ViewModels;
using Microsoft.Phone.Controls;
using System;

namespace Juick
{
    public partial class LoginView : PhoneApplicationPage
    {
        public LoginView()
        {
            InitializeComponent();
            Loaded += (sender, args) =>
                          {
                              while (NavigationService.BackStack.Any())
                                  NavigationService.RemoveBackEntry();
                          };
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            ((LoginViewModel)DataContext).NextUri = NavigationContext.QueryString.ContainsKey("FileId")
                ? new Uri(string.Format("/NewPostView.xaml?FileId={0}", NavigationContext.QueryString["FileId"]), UriKind.Relative)
                : new Uri("/MainPage.xaml", UriKind.Relative);
        }
    }
}