minor modified code

This commit is contained in:
NaBian committed 2021-09-08 23:03:49 +08:00
1 parent 43c2f67171
commit 07a280ca14
2 files changed
+9 -4

No files matched your search

@@ -13,11 +13,16 @@ namespace HandyControl.Controls
public class HighlightTextBlock : TextBlock
{
public static readonly DependencyProperty SourceTextProperty =
DependencyProperty.Register("SourceText", typeof(string), typeof(HighlightTextBlock), new PropertyMetadata(null, OnSourceTextChanged));
DependencyProperty.Register("SourceText", typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnSourceTextChanged));
public static readonly DependencyProperty QueriesTextProperty =
DependencyProperty.Register("QueriesText", typeof(string), typeof(HighlightTextBlock), new PropertyMetadata(null, OnQueriesTextChanged));
DependencyProperty.Register("QueriesText", typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnQueriesTextChanged));
public static readonly DependencyProperty HighlightBrushProperty =
DependencyProperty.Register("HighlightBrush", typeof(Brush), typeof(HighlightTextBlock), new PropertyMetadata(Brushes.Yellow));
DependencyProperty.Register("HighlightBrush", typeof(Brush), typeof(HighlightTextBlock),
new PropertyMetadata(Brushes.Yellow));
private static void OnSourceTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((HighlightTextBlock) d).RefreshInlines();