using System.Linq; using System.Windows; using Microsoft.Phone.Controls; using System; namespace Juick { public partial class LoginView : PhoneApplicationPage { public LoginView() { InitializeComponent(); DataContext = App.AppContext.Account.Credentials; } private Uri nextUri; protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { nextUri = NavigationContext.QueryString.ContainsKey("FileId") ? new Uri(string.Format("/NewPostView.xaml?FileId={0}", NavigationContext.QueryString["FileId"]), UriKind.Relative) : new Uri("/MainPage.xaml", UriKind.Relative); } private void button1_Click(object sender, RoutedEventArgs e) { App.AppContext.Account.SignIn(this, textBox1.Text, textBox2.Password, nextUri); } private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { while (NavigationService.BackStack.Any()) NavigationService.RemoveBackEntry(); } } }