private void MenuItem_Click(object sender, RoutedEventArgs e) { string text = new TextRange(txtSource.Document.ContentStart, txtSource.Document.ContentEnd).Text; TextAnalyzerWorker textAnalyzer = new TextAnalyzerWorker(text); Report reportWindow = new Report(textAnalyzer); reportWindow.ShowDialog(); }
public Report(TextAnalyzerWorker textAnalyzer) { InitializeComponent(); this.dataLetters.ItemsSource = textAnalyzer.letters; this.dataWords.ItemsSource = textAnalyzer.all_words[0]; this.dataWords2.ItemsSource = textAnalyzer.all_words[1]; this.dataWords3.ItemsSource = textAnalyzer.all_words[2]; this.dataWords4.ItemsSource = textAnalyzer.all_words[3]; this.dataWords5.ItemsSource = textAnalyzer.capitalWords; foreach (DataGridColumn c in dataWords.Columns) { c.SortDirection = null; } dataWords.Columns[1].SortDirection = System.ComponentModel.ListSortDirection.Descending; this.dataWords.Items.Refresh(); }