private void ChangeOcrDisplayWordColor(int index) { if (index < wordsView.Items.Count) { var item = wordsView.Items[index] as OcrOneWordModel; if (item != null) { if (selectedWord != null) { selectedWord.Brush = UIUtilities.Green; } selectedWord = item; selectedWord.Brush = UIUtilities.Orange; } } }
private void OnWordClicked(object sender, RoutedEventArgs e) { Button button = sender as Button; if (button == null) { return; } OcrOneWordModel word = button.DataContext as OcrOneWordModel; if (word == null) { return; } ShowWordsPopup(viewModel.TextBlocks[word.Index], word.Index, button); }