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 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 readonly Dictionary<string, HierarchicalSelectionItem> categoryLookup = new Dictionary<string, HierarchicalSelectionItem>(StringComparer.OrdinalIgnoreCase);
private bool isCategoryLoading;
private Brush defaultCategoryBorderBrush;
private Brush defaultQuickTicketBorderBrush;
private readonly Brush validationErrorBrush = new SolidColorBrush(Colors.Red);
private readonly Brush validationErrorBrush = SharedValidationBorderBrush;
private Brush defaultTicketStatusBorderBrush;
public bool IsTicket
@@ -2198,7 +2207,7 @@ namespace FasdDesktopUi.Basics.UserControls
}
else
{
CaseNotesPreviewBorder.BorderBrush = new SolidColorBrush(Colors.Red);
CaseNotesPreviewBorder.BorderBrush = SharedValidationBorderBrush;
}
}
@@ -2336,7 +2345,7 @@ namespace FasdDesktopUi.Basics.UserControls
// if (selectedItem.Tag == null)
// {
// // Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
// comboBox.BorderBrush = new SolidColorBrush(Colors.Red);
// comboBox.BorderBrush = SharedValidationBorderBrush;
// }
// else
// {
@@ -2416,7 +2425,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (string.IsNullOrWhiteSpace(text))
{
// Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
textBox.BorderBrush = new SolidColorBrush(Colors.Red);
textBox.BorderBrush = SharedValidationBorderBrush;
}
else
{
@@ -2434,7 +2443,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (notEmpty && string.IsNullOrWhiteSpace(_textBlock.Text))
{
_retVal = true;
_borderCaseNores = new SolidColorBrush(Colors.Red);
_borderCaseNores = SharedValidationBorderBrush;
}
CaseNotesPreviewBorder.BorderBrush = _borderCaseNores;
return _retVal;
@@ -2449,7 +2458,7 @@ namespace FasdDesktopUi.Basics.UserControls
if (hasError)
{
// Setze die Hintergrundfarbe auf Rot, um einen Validierungsfehler anzuzeigen
textBox.BorderBrush = new SolidColorBrush(Colors.Red);
textBox.BorderBrush = SharedValidationBorderBrush;
}
else
{