summaryrefslogtreecommitdiff
path: root/Juick/LoginView.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/LoginView.xaml.cs')
-rw-r--r--Juick/LoginView.xaml.cs22
1 files changed, 7 insertions, 15 deletions
diff --git a/Juick/LoginView.xaml.cs b/Juick/LoginView.xaml.cs
index 098275b..06ac58c 100644
--- a/Juick/LoginView.xaml.cs
+++ b/Juick/LoginView.xaml.cs
@@ -1,5 +1,6 @@
using System.Linq;
using System.Windows;
+using Juick.ViewModels;
using Microsoft.Phone.Controls;
using System;
@@ -10,27 +11,18 @@ namespace Juick
public LoginView()
{
InitializeComponent();
- DataContext = App.AppContext.Account.Credentials;
+ Loaded += (sender, args) =>
+ {
+ while (NavigationService.BackStack.Any())
+ NavigationService.RemoveBackEntry();
+ };
}
- private Uri nextUri;
-
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
- nextUri = NavigationContext.QueryString.ContainsKey("FileId")
+ ((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);
}
-
- 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();
- }
}
} \ No newline at end of file