| 1 | using Avalonia; |
| 2 | using Avalonia.Controls; |
| 3 | using Avalonia.Media; |
| 4 | |
| 5 | namespace CascadeIDE.Views.UiKit; |
| 6 | |
| 7 | public partial class EcamReadout : UserControl |
| 8 | { |
| 9 | public static readonly StyledProperty<string?> LabelProperty = |
| 10 | AvaloniaProperty.Register<EcamReadout, string?>(nameof(Label)); |
| 11 | |
| 12 | public static readonly StyledProperty<string?> ValueTextProperty = |
| 13 | AvaloniaProperty.Register<EcamReadout, string?>(nameof(ValueText)); |
| 14 | |
| 15 | public static readonly StyledProperty<string?> SubTextProperty = |
| 16 | AvaloniaProperty.Register<EcamReadout, string?>(nameof(SubText)); |
| 17 | |
| 18 | public static readonly StyledProperty<double> ValueFontSizeProperty = |
| 19 | AvaloniaProperty.Register<EcamReadout, double>(nameof(ValueFontSize), defaultValue: 16); |
| 20 | |
| 21 | public static readonly StyledProperty<FontWeight> ValueFontWeightProperty = |
| 22 | AvaloniaProperty.Register<EcamReadout, FontWeight>(nameof(ValueFontWeight), defaultValue: FontWeight.SemiBold); |
| 23 | |
| 24 | public string? Label |
| 25 | { |
| 26 | get => GetValue(LabelProperty); |
| 27 | set => SetValue(LabelProperty, value); |
| 28 | } |
| 29 | |
| 30 | public string? ValueText |
| 31 | { |
| 32 | get => GetValue(ValueTextProperty); |
| 33 | set => SetValue(ValueTextProperty, value); |
| 34 | } |
| 35 | |
| 36 | public string? SubText |
| 37 | { |
| 38 | get => GetValue(SubTextProperty); |
| 39 | set => SetValue(SubTextProperty, value); |
| 40 | } |
| 41 | |
| 42 | public double ValueFontSize |
| 43 | { |
| 44 | get => GetValue(ValueFontSizeProperty); |
| 45 | set => SetValue(ValueFontSizeProperty, value); |
| 46 | } |
| 47 | |
| 48 | public FontWeight ValueFontWeight |
| 49 | { |
| 50 | get => GetValue(ValueFontWeightProperty); |
| 51 | set => SetValue(ValueFontWeightProperty, value); |
| 52 | } |
| 53 | |
| 54 | public EcamReadout() |
| 55 | { |
| 56 | InitializeComponent(); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | |