Files

86 lines
6.0 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Themes/CommonStyles.xaml.cs
- Common/DTS.Common/Themes/BrushesAndColors.cs
generated_at: "2026-04-17T15:41:27.517145+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "531940e84f244acd"
---
# Documentation: DTS.Common.Themes
## 1. Purpose
This module provides centralized access to WPF visual styling resources for the DTS application. `CommonStyles.xaml.cs` serves as code-behind for a XAML resource dictionary, enabling tool tip event handling with event aggregation support. `BrushesAndColors.cs` acts as a static cache layer for brushes and colors defined in application resources, improving lookup performance by caching `SolidColorBrush` and `Brush` instances after first access. This module exists to standardize UI styling across the application and provide a type-safe, performant way to access theme resources.
---
## 2. Public Interface
### CommonStyles (partial class)
| Member | Signature | Description |
|--------|-----------|-------------|
| `ToolTipEventHandler` | `public void ToolTipEventHandler(object sender, System.Windows.Controls.ToolTipEventArgs e)` | Handles tool tip events by marking them as handled and publishing a `HelpTextEvent` via the `IEventAggregator`. Wraps the sender and event args in a `HelpTextEventArg` payload. |
### BrushesAndColors (abstract class)
All members are static properties. Brushes are lazily initialized and frozen on first access.
#### Brush Properties (cached, lazy-loaded)
| Property | Type | Resource Key Looked Up |
|----------|------|------------------------|
| `Brush_ApplicationTileExport` | `SolidColorBrush` | `Brush_ApplicationTileExport` |
| `Brush__ApplicationTileCollectData` | `SolidColorBrush` | `Brush_ApplicationTileCollectData` (note: property name has double underscore) |
| `Brush_ApplicationStatus_Failed` | `SolidColorBrush` | `Brush_ApplicationStatus_Failed` |
| `Brush_ApplicationStatus_TSRAIRGo_Failed` | `SolidColorBrush` | `Brush_ApplicationStatus_TSRAIRGo_Failed` |
| `Brush_Dimmed_Text` | `SolidColorBrush` | `Brush_Dimmed_TextForeground` |
| `Brush_Application_Idle` | `SolidColorBrush` | `Brush_ApplicationStatus_Idle` |
| `Brush_ApplicationStatus_Complete` | `SolidColorBrush` | `Brush_ApplicationStatus_Complete` |
| `Brush_ApplicationStatus_TSRAIRGo_Complete` | `SolidColorBrush` | `Brush_ApplicationStatus_TSRAIRGo_Complete` |
| `Brush_ApplicationStatus_Idle` | `SolidColorBrush` | `Brush_ApplicationStatus_Idle` |
| `Brush_ApplicationStatus_Busy` | `SolidColorBrush` | `Brush_ApplicationStatus_Busy` |
| `Brush_ApplicationStatus_TSRAIRGo_Busy` | `SolidColorBrush` | `Brush_ApplicationStatus_TSRAIRGo_Busy` |
| `Brush_Run_SensorIdNotFound` | `SolidColorBrush` | `Brush_Run_SensorIdNotFound` |
| `Brush_Run_SensorIdOutOfPlace` | `SolidColorBrush` | `Brush_Run_SensorIdOutOfPlace` |
| `Brush_Table_AlternatingRowBackground` | `SolidColorBrush` | `Brush_Table_AlternatingRowBackground` |
| `Brush_Table_RowBackground` | `SolidColorBrush` | `Brush_Table_RowBackground` |
| `Brush_FlatControlPressedBackground` | `Brush` | `Brush_FlatControlPressedBackground` |
| `Brush_FlatControlPressedForeground` | `Brush` | `Brush_FlatControlPressedForeground` |
| `Brush_Transparent` | `Brush` | Creates new `SolidColorBrush(Colors.Transparent)` (not resource-based) |
| `Brush_NoError` | `Brush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Error` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Warning` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_Attention` | `SolidColorBrush` | Loaded from `/DTS.Common;component/Themes/brushes.xaml` |
| `Brush_FlatControlDisabledForeground` | `Brush` | `Brush_FlatControlDisabledForeground` |
| `Brush_ApplicationContentForeground` | `Brush` | `Brush_ApplicationContentForeground` |
| `Brush_FlatControlDisabledBackground` | `Brush` | `Brush_FlatControlDisabledBackground` |
| `Brush_ApplicationStatus_Waiting` | `SolidColorBrush` | `Brush_ApplicationStatus_Waiting` |
| `Brush_ApplicationStatus_Failed_ActionBackground` | `SolidColorBrush` | `Brush_ApplicationStatus_Failed_ActionBackground` |
| `Brush_ApplicationStatus_Complete_ActionBackground` | `SolidColorBrush` | `Brush_ApplicationStatus_Complete_ActionBackground` |
| `Brush_ApplicationStatus_Failed_SystemProcess` | `SolidColorBrush` | `Brush_ApplicationStauts_Failed_SystemProcess` (note: typo in resource key) |
| `Brush_ApplicationFooterBackground` | `SolidColorBrush` | `Brush_ApplicationFooterBackground` |
| `Brush_ApplicationLicensingFooterBackground` | `SolidColorBrush` | `Brush_ApplicationLicensingFooterBackground` |
| `Brush_Realtime_OSC_SELECTED` | `Brush` | `Brush_Realtime_OSC_SELECTED` |
| `Brush_Realtime_OSC_UNSELECTED` | `Brush` | `Brush_Realtime_OSC_UNSELECTED` |
| `Brush_Realtime_METER_SELECTED` | `Brush` | `Brush_Realtime_METER_SELECTED` |
| `Brush_Realtime_METER_UNSELECTED` | `Brush` | `Brush_Realtime_METER_UNSELECTED` |
| `Brush_SensorIdFound` | `SolidColorBrush` | `Brush_SensorIdFound` |
| `Brush_ArmSystemForeground` | `SolidColorBrush` | `Brush_ArmSystemForeground` |
| `Brush_ApplicationTilePrepare` | `SolidColorBrush` | `Brush_ApplicationTilePrepare` |
| `Brush_ApplicationTileSetup` | `SolidColorBrush` | `Brush_ApplicationTileSetup` |
| `BrushApplicationStatusPowerRed` | `SolidColorBrush` | `Brush_ApplicationStatusPowerRed` |
| `BrushApplicationStatusPowerYellow` | `SolidColorBrush` | `Brush_ApplicationStatusPowerYellow` |
| `BrushApplicationStatusPowerGreen` | `SolidColorBrush` | `Brush_ApplicationStatusPowerGreen` |
| `BrushFlatControlDarkForeground` | `SolidColorBrush` | `Brush_FlatControlDarkForeground` |
| `BrushButtonBorderForeground` | `SolidColorBrush` | `Brush_ButtonBorderForeground` |
| `BrushApplicationStatusPowerClear` | `SolidColorBrush` | `Brush_ApplicationStatusPowerClear` |
#### Color Properties (not cached, looked up each time)
| Property | Type | Resource Key |
|----------|------|--------------|
| `Color_ActionBackground` | `Color` | `Color_ActionBackground` |
| `Color_ApplicationTileCollect