private void login_Click(object sender, RoutedEventArgs e) { string usr = username.Text; string psw = password.Text; if (psw != string.Empty && usr != string.Empty) { UserContext usc = ServiceCalls.Login(usr, psw); if (usc.Authenticated) { Frame.Navigate(typeof(Main), new NavigationContext() { UserContext = usc }); } else { status.Text = "Failed to login."; } } }