This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
---
source_files:
- DataPRO/Modules/Groups/GroupChannelList/Converters/BooleanToWidthConverter.cs
- DataPRO/Modules/Groups/GroupChannelList/Converters/SensorIdBackgroundConverter.cs
generated_at: "2026-04-17T16:13:20.076259+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e25d08690ef1d9de"
---
# Converters
### Purpose
This module provides WPF value converters for the `GroupChannelList` UI component. It exists to transform data values into visual representations in XAML bindings, specifically converting boolean values to width measurements and background brush colors for sensor ID display elements.
### Public Interface
- **`BooleanToWidthConverter` class** (public) - Implements `IValueConverter`. Converts boolean values to width values for UI element sizing.
- `object Convert(object value, Type targetType, object parameter, CultureInfo culture)` - Returns `width` (parsed from parameter) if `value` is `true`, returns `0` if `value` is `false`, returns `0` if `value` is `null`. If parameter parsing fails, returns `double.NaN`.
- `object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)` - Throws `NotImplementedException`.
- **`SensorIdBackgroundConverter` class** (public) - Implements `IValueConverter`. Converts boolean values to background brush colors.
- `object Convert(object value, Type targetType, object parameter, CultureInfo culture)` - Returns a light green brush (`#FFE3FBE1`) if `value` is `true`, returns `Brushes.Transparent` if `value` is `false` or `null`. Catches and traces exceptions.
- `object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)` - Throws `NotImplementedException`.
### Invariants
- `ConvertBack` is not implemented on either converter; these are one-way converters only.
- `SensorIdBackgroundConverter.SensorIdBrush` is a static field that is frozen before return to make it thread-safe and non-modifiable.
### Dependencies
- **Depends on**: `System.Windows.Data.IValueConverter`, `System.Windows.Media.SolidColorBrush`, `System.Windows.Media.Color`, `System.Windows.Media.Brushes`, `System.Globalization.CultureInfo`, `System.Diagnostics.Trace`.
- **Depended on by**: XAML views in the `GroupChannelList