private Brush GetBrushForCurrentTheme(ThemeBrushTarget target) { var attribute = this.SyntaxHighlightingStyle.GetAttributes <AssociatedThemeBrushAttribute>() .FirstOrDefault(x => (x.AssociatedTheme == this.ApplicationTheme || x.AssociatedTheme == ApplicationTheme.Any) && x.Target == target); return(attribute?.AssociatedBrush ?? new SolidColorBrush(Colors.Red)); }
public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, string associatedBrush) { this.AssociatedBrush = (SolidColorBrush)new BrushConverter().ConvertFromString(associatedBrush); this.AssociatedTheme = associatedTheme; this.Target = target; }
public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, Brush associatedBrush) { this.AssociatedBrush = associatedBrush; this.AssociatedTheme = associatedTheme; this.Target = target; }
private Brush GetBrushForCurrentTheme(ThemeBrushTarget target) { var attribute = this.SyntaxHighlightingStyle.GetAttributes<AssociatedThemeBrushAttribute>() .FirstOrDefault(x => (x.AssociatedTheme == this.ApplicationTheme || x.AssociatedTheme == ApplicationTheme.Any) && x.Target == target); return attribute?.AssociatedBrush ?? new SolidColorBrush(Colors.Red); }
public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, string associatedBrush) { this.AssociatedBrush = (SolidColorBrush) new BrushConverter().ConvertFromString(associatedBrush); this.AssociatedTheme = associatedTheme; this.Target = target; }