/// <summary> /// This takes care of creating the view model, publishing it, and disposing afterwards /// </summary> /// <param name="clip">Clip</param> /// <param name="javaStacktraceCleaner">JavaStacktraceCleaner</param> private void ShowToast(Clip clip, JavaStacktraceCleaner javaStacktraceCleaner) { var viewModel = new CleanStacktraceToastViewModel(clip, javaStacktraceCleaner); // Show the ViewModel as toast _eventAggregator.PublishOnUIThread(viewModel); }
/// <summary> /// Handle the clipboard update /// </summary> /// <param name="repositoryUpdateArgs"></param> private void OnNext(RepositoryUpdateArgs <Clip> repositoryUpdateArgs) { var clip = repositoryUpdateArgs.Entity; if (!clip.HasText()) { return; } var javaStacktraceCleaner = new JavaStacktraceCleaner(clip.ClipboardText); if (!javaStacktraceCleaner.IsStacktrace && !javaStacktraceCleaner.HasModifications) { return; } ShowToast(clip, javaStacktraceCleaner); }