protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e) { if (_login != null) { LayoutRoot.Children.Remove(_login); _login = null; e.Cancel = true; } else { base.OnBackKeyPress(e); } }
public void LoginCallback(bool verified) { if (verified) { LoginText.Text = "logout"; CoreServices.Instance.MyPosts.Refresh(); CoreServices.Instance.MyReplies.Refresh(); IncrementRefresher(); IncrementRefresher(); } LayoutRoot.Children.Remove(_login); _login = null; }
private void RefreshClick(object sender, EventArgs e) { if (!CoreServices.Instance.LoginVerified && _login == null) { _login = new LoginControl(LoginCallback); LayoutRoot.Children.Add(_login); return; } MessageList messages; switch (Pivot.SelectedIndex) { case 0: messages = CoreServices.Instance.Inbox; break; case 1: messages = CoreServices.Instance.Outbox; break; case 2: messages = CoreServices.Instance.Archive; break; default: messages = CoreServices.Instance.Inbox; break; } messages.PropertyChanged += BoxLoaded; messages.Refresh(); ProgressBar.Visibility = Visibility.Visible; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (!CoreServices.Instance.LoginVerified) { _login = new LoginControl(LoginCallback); LayoutRoot.Children.Add(_login); } else { LoadPage(); } base.OnNavigatedTo(e); }
public void LoginCallback(bool verified) { if (verified) { LoadPage(); } LayoutRoot.Children.Remove(_login); _login = null; }
private void Login_Click(object sender, RoutedEventArgs e) { if (!CoreServices.Instance.LoginVerified) { _login = new LoginControl(LoginCallback); LayoutRoot.Children.Add(_login); } else { CoreServices.Instance.Logout(); LoginText.Text = "login"; } }