fix roter rahmen

This commit is contained in:
Meik
2025-11-13 13:09:36 +01:00
parent 1aefa425e0
commit 5a8cbe8716

View File

@@ -71,12 +71,21 @@ namespace FasdDesktopUi.Basics.UserControls
private const string CategoryTableNameLegacy = "M42Wpm-Ticket-CloseCase-Categories"; private const string CategoryTableNameLegacy = "M42Wpm-Ticket-CloseCase-Categories";
private string activeCategoryTableName = CategoryTableNamePrimary; private string activeCategoryTableName = CategoryTableNamePrimary;
private static readonly Brush SharedValidationBorderBrush = CreateValidationBrush();
private static Brush CreateValidationBrush()
{
var brush = new SolidColorBrush(Color.FromRgb(0xF5, 0x7C, 0x73));
if (brush.CanFreeze)
brush.Freeze();
return brush;
}
private ObservableCollection<HierarchicalSelectionItem> categoryHierarchy = new ObservableCollection<HierarchicalSelectionItem>(); private ObservableCollection<HierarchicalSelectionItem> categoryHierarchy = new ObservableCollection<HierarchicalSelectionItem>();
private readonly Dictionary<string, HierarchicalSelectionItem> categoryLookup = new Dictionary<string, HierarchicalSelectionItem>(StringComparer.OrdinalIgnoreCase); private readonly Dictionary<string, HierarchicalSelectionItem> categoryLookup = new Dictionary<string, HierarchicalSelectionItem>(StringComparer.OrdinalIgnoreCase);
private bool isCategoryLoading; private bool isCategoryLoading;
private Brush defaultCategoryBorderBrush; private Brush defaultCategoryBorderBrush;
private Brush defaultQuickTicketBorderBrush; private Brush defaultQuickTicketBorderBrush;
private readonly Brush validationErrorBrush = new SolidColorBrush(Colors.Red); private readonly Brush validationErrorBrush = SharedValidationBorderBrush;
private Brush defaultTicketStatusBorderBrush; private Brush defaultTicketStatusBorderBrush;
public bool IsTicket public bool IsTicket
@@ -2198,9 +2207,9 @@ namespace FasdDesktopUi.Basics.UserControls
} }
else else
{ {
CaseNotesPreviewBorder.BorderBrush = new SolidColorBrush(Colors.Red); CaseNotesPreviewBorder.BorderBrush = SharedValidationBorderBrush;
} }
} }
private void EditCaseNotesButton_TouchDown(object sender, TouchEventArgs e) private void EditCaseNotesButton_TouchDown(object sender, TouchEventArgs e)
{ {
@@ -2336,7 +2345,7 @@ namespace FasdDesktopUi.Basics.UserControls
// if (selectedItem.Tag == null) // if (selectedItem.Tag == null)
// { // {
// // Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen // // Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
// comboBox.BorderBrush = new SolidColorBrush(Colors.Red); // comboBox.BorderBrush = SharedValidationBorderBrush;
// } // }
// else // else
// { // {
@@ -2416,7 +2425,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (string.IsNullOrWhiteSpace(text)) if (string.IsNullOrWhiteSpace(text))
{ {
// Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen // Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
textBox.BorderBrush = new SolidColorBrush(Colors.Red); textBox.BorderBrush = SharedValidationBorderBrush;
} }
else else
{ {
@@ -2434,7 +2443,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (notEmpty && string.IsNullOrWhiteSpace(_textBlock.Text)) if (notEmpty && string.IsNullOrWhiteSpace(_textBlock.Text))
{ {
_retVal = true; _retVal = true;
_borderCaseNores = new SolidColorBrush(Colors.Red); _borderCaseNores = SharedValidationBorderBrush;
} }
CaseNotesPreviewBorder.BorderBrush = _borderCaseNores; CaseNotesPreviewBorder.BorderBrush = _borderCaseNores;
return _retVal; return _retVal;
@@ -2449,7 +2458,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (hasError) if (hasError)
{ {
// Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen // Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
textBox.BorderBrush = new SolidColorBrush(Colors.Red); textBox.BorderBrush = SharedValidationBorderBrush;
} }
else else
{ {