private void ViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs e) { if (ViewModel == null) { return; } if (e.PropertyName == "Description") { if (string.IsNullOrEmpty(ViewModel.Description)) { return; } HyperlinkHighlighter.HighlightUrls(ViewModel.Description, DescriptionRcTbx); return; } if (e.PropertyName != "IsSubscribed") { return; } ClearAppBar(); AddAppBarButtons(); }
private static void TextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var richTextBox = d as RichTextBox; if (richTextBox == null) { return; } if (e.NewValue == null) { return; } HyperlinkHighlighter.HighlightUrls(e.NewValue.ToString(), richTextBox); }