Skip to content

Commit

Permalink
Merge branch 'master' into unaryOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 authored Dec 8, 2020
2 parents a29dca6 + 9b75c9f commit fe1182b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Microsoft.Toolkit.Uwp.SampleApp/Controls/XamlCodeEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public sealed partial class XamlCodeEditor : UserControl
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(nameof(Text), typeof(string), typeof(XamlCodeEditor), new PropertyMetadata(string.Empty));

private ThemeListener _themeListener = new ThemeListener();

public XamlCodeEditor()
{
this.InitializeComponent();
Expand All @@ -40,7 +42,7 @@ public async void ReportError(XamlExceptionRange error)
// Highlight Error Line
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
range,
new IModelDecorationOptions() { IsWholeLine = true, ClassName = _errorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));
new IModelDecorationOptions() { IsWholeLine = true, ClassName = ErrorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));

// Show Glyph Icon
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
Expand Down Expand Up @@ -121,10 +123,12 @@ public string Text

public DateTime TimeSampleEditedLast { get; private set; } = DateTime.MinValue;

private CssLineStyle _errorStyle = new CssLineStyle()
private CssLineStyle ErrorStyle
{
BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6))
};
get => _themeListener.CurrentTheme.Equals(ApplicationTheme.Light) ?
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6)) } :
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0x66, 0x00, 0x00)) };
}

private CssGlyphStyle _errorIconStyle = new CssGlyphStyle()
{
Expand Down

0 comments on commit fe1182b

Please sign in to comment.