@@ -21,6 +21,8 @@ public sealed partial class XamlCodeEditor : UserControl
21
21
public static readonly DependencyProperty TextProperty =
22
22
DependencyProperty . Register ( nameof ( Text ) , typeof ( string ) , typeof ( XamlCodeEditor ) , new PropertyMetadata ( string . Empty ) ) ;
23
23
24
+ private ThemeListener _themeListener = new ThemeListener ( ) ;
25
+
24
26
public XamlCodeEditor ( )
25
27
{
26
28
this . InitializeComponent ( ) ;
@@ -40,7 +42,7 @@ public async void ReportError(XamlExceptionRange error)
40
42
// Highlight Error Line
41
43
XamlCodeRenderer . Decorations . Add ( new IModelDeltaDecoration (
42
44
range ,
43
- new IModelDecorationOptions ( ) { IsWholeLine = true , ClassName = _errorStyle , HoverMessage = new string [ ] { error . Message } . ToMarkdownString ( ) } ) ) ;
45
+ new IModelDecorationOptions ( ) { IsWholeLine = true , ClassName = ErrorStyle , HoverMessage = new string [ ] { error . Message } . ToMarkdownString ( ) } ) ) ;
44
46
45
47
// Show Glyph Icon
46
48
XamlCodeRenderer . Decorations . Add ( new IModelDeltaDecoration (
@@ -121,10 +123,12 @@ public string Text
121
123
122
124
public DateTime TimeSampleEditedLast { get ; private set ; } = DateTime . MinValue ;
123
125
124
- private CssLineStyle _errorStyle = new CssLineStyle ( )
126
+ private CssLineStyle ErrorStyle
125
127
{
126
- BackgroundColor = new SolidColorBrush ( Color . FromArgb ( 0x00 , 0xFF , 0xD6 , 0xD6 ) )
127
- } ;
128
+ get => _themeListener . CurrentTheme . Equals ( ApplicationTheme . Light ) ?
129
+ new CssLineStyle ( ) { BackgroundColor = new SolidColorBrush ( Color . FromArgb ( 0x00 , 0xFF , 0xD6 , 0xD6 ) ) } :
130
+ new CssLineStyle ( ) { BackgroundColor = new SolidColorBrush ( Color . FromArgb ( 0x00 , 0x66 , 0x00 , 0x00 ) ) } ;
131
+ }
128
132
129
133
private CssGlyphStyle _errorIconStyle = new CssGlyphStyle ( )
130
134
{
0 commit comments