public void ShowAccessDialog() { var view = new TokenAccessView() { DataContext = TokenAccessViewModel, }; TokenAccessViewModel.RequestClose += (sender, e) => { view.Close(); }; view.ShowDialog(); TweetSearchViewModel.UpdateStatus(); }
public MainViewModel() { Tweets = new List <IScrapItem>(); _tweetSearcher = new TweetSearcher(); SaveCommand = new RelayCommand(Save); ExitCommand = new RelayCommand(Exit); ShowAccessDialogCommand = new RelayCommand(ShowAccessDialog); TokenAccessViewModel = new TokenAccessViewModel(_tweetSearcher); TweetSearchViewModel = new TweetSearchViewModel(_tweetSearcher); TweetSearchViewModel.Tweets.CollectionChanged += Tweets_CollectionChanged; TokenAccessViewModel.TokenAccessRequested += () => { TweetSearchViewModel.UpdateStatus(); }; }