summaryrefslogtreecommitdiff
path: root/Juick/LoginView.xaml.cs
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-03 05:03:20 +0400
committerGravatar Vitaly Takmazov2013-04-03 05:03:20 +0400
commit151e56ec2e3466389804b8874b4224bf6bd08097 (patch)
tree4b2c07be26036e470afba1f399619c8d64ae8216 /Juick/LoginView.xaml.cs
parent4959050e7996e92ac97f4d05064130251a0628c5 (diff)
New pages, LoginViewModel, Validation (in progress)
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