public MainWindow() { InitializeComponent(); var token = CredentialHelper.Get(); if (null == token) { var logonWin = new Logon(); var dialogResult = logonWin.ShowDialog(); if (!dialogResult.HasValue || !dialogResult.Value) { this.Close(); } } this.DataContext = viewModel; poster.ViewModel = viewModel; }
private void HandleSwitchUserBtnClicked(object sender, RoutedEventArgs e) { this.DoBlur(); var logonWin = new Logon(); logonWin.Owner = this; logonWin.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; var dialogResult = logonWin.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { viewModel.AtMeStatuses.Clear(); viewModel.CommentsByMe.Clear(); viewModel.CommentsToMe.Clear(); viewModel.Counters.Clear(); viewModel.FavouriteStatuses.Clear(); viewModel.Followers.Clear(); viewModel.Followings.Clear(); viewModel.MyHomeStatuses.Clear(); viewModel.MyStatuses.Clear(); DoLoading(); } this.UndoBlur(); }