csharpdeeb25a2 | 1 | using System.Globalization; |
| 2 | using Avalonia.Data.Converters; |
| 3 | using Avalonia.Media; |
| 4 | using CascadeIDE.Cockpit.PrimitivesKit; |
| 5 | using CascadeIDE.Models; |
| 6 | |
| 7 | namespace CascadeIDE.Views; |
| 8 | |
| 9 | /// <summary>Цвет заголовка строки по уровню лампы (таблица / MFD).</summary> |
| 10 | public sealed class AnnunciatorLampLevelToBrushConverter : IValueConverter |
| 11 | { |
| 12 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) |
| 13 | { |
| 14 | if (value is not AnnunciatorLampLevel level) |
| 15 | return Brushes.Gray; |
| 16 | |
| 17 | return new SolidColorBrush(CockpitPrimitivesPalette.Annunciator.RowAccent(level)); |
| 18 | } |
| 19 | |
| 20 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => |
| 21 | throw new NotSupportedException(); |
| 22 | } |
| 23 | |
View only · write via MCP/CIDE