private void Login() { Login login = Persistance.GetLoginData(EnteredName).Result; if (login == null) { MessageDialog msg = new MessageDialog("This name doesn't exist!"); msg.ShowAsync(); //NavigationService ns = new NavigationService(); //ns.Navigate(typeof(LoginPage)); } else { if (login.Password == EnteredPassword) { LoggedInSingleton singletonlog = LoggedInSingleton.Instance; singletonlog.LoggedStudentID = login.StudentID; NavigateToMenu(); } else { MessageDialog msg = new MessageDialog("Entered password is incorrect!"); msg.ShowAsync(); //NavigationService ns = new NavigationService(); //ns.Navigate(typeof(LoginPage)); } } }