rote rahmen für req im fallabschluss
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
BIN
2025-11-13 14_52_24-.png
Normal file
BIN
2025-11-13 14_52_24-.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -204,6 +204,7 @@
|
|||||||
DropDownClosed="ComboBoxControl_DropDownClosed"
|
DropDownClosed="ComboBoxControl_DropDownClosed"
|
||||||
Background="{Binding ElementName=ComboBoxPagableUc, Path=ComboBoxBackground}"
|
Background="{Binding ElementName=ComboBoxPagableUc, Path=ComboBoxBackground}"
|
||||||
BorderBrush="{Binding ElementName=ComboBoxPagableUc, Path=BorderBrush}"
|
BorderBrush="{Binding ElementName=ComboBoxPagableUc, Path=BorderBrush}"
|
||||||
|
BorderThickness="0"
|
||||||
ItemsSource="{Binding ElementName=ComboBoxPagableUc, Path=ItemData}"
|
ItemsSource="{Binding ElementName=ComboBoxPagableUc, Path=ItemData}"
|
||||||
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ComboBoxPageable}}, Path=SelectedItem, Mode=TwoWay}"
|
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ComboBoxPageable}}, Path=SelectedItem, Mode=TwoWay}"
|
||||||
DisplayMemberPath="Key"
|
DisplayMemberPath="Key"
|
||||||
|
|||||||
@@ -1944,11 +1944,13 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
if (closeTicketDialog2.SelectedErrorType == null || closeTicketDialog2.SelectedErrorType is ComboBoxItem b && b.Tag == null)
|
if (closeTicketDialog2.SelectedErrorType == null || closeTicketDialog2.SelectedErrorType is ComboBoxItem b && b.Tag == null)
|
||||||
{
|
{
|
||||||
|
closeTicketDialog2.UpdateErrorTypeValidationState(true);
|
||||||
if (!_errors.ContainsKey(propertyName))
|
if (!_errors.ContainsKey(propertyName))
|
||||||
_errors.Add(propertyName, cMultiLanguageSupport.GetItem("Dialog.CloseCase.ValidationErrorTypeEmpty"));
|
_errors.Add(propertyName, cMultiLanguageSupport.GetItem("Dialog.CloseCase.ValidationErrorTypeEmpty"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
closeTicketDialog2.UpdateErrorTypeValidationState(false);
|
||||||
if (_errors.ContainsKey(propertyName))
|
if (_errors.ContainsKey(propertyName))
|
||||||
_errors.Remove(propertyName);
|
_errors.Remove(propertyName);
|
||||||
}
|
}
|
||||||
@@ -1958,8 +1960,12 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
case "SelectedRoleAndPerson":
|
case "SelectedRoleAndPerson":
|
||||||
if (DynamicStatusAdditionBorder.Child is ForwardTicketDialog forwardTicketDialog)
|
if (DynamicStatusAdditionBorder.Child is ForwardTicketDialog forwardTicketDialog)
|
||||||
{
|
{
|
||||||
if ((forwardTicketDialog.SelectedPerson.Key == null || forwardTicketDialog.SelectedPerson.Value == null) &&
|
bool hasError = (forwardTicketDialog.SelectedPerson.Key == null || forwardTicketDialog.SelectedPerson.Value == null) &&
|
||||||
(forwardTicketDialog.SelectedRole.Key == null || forwardTicketDialog.SelectedRole.Value == null))
|
(forwardTicketDialog.SelectedRole.Key == null || forwardTicketDialog.SelectedRole.Value == null);
|
||||||
|
|
||||||
|
forwardTicketDialog.UpdateResponsibleSelectionValidationState(hasError);
|
||||||
|
|
||||||
|
if (hasError)
|
||||||
{
|
{
|
||||||
if (!_errors.ContainsKey(propertyName))
|
if (!_errors.ContainsKey(propertyName))
|
||||||
_errors.Add(propertyName, cMultiLanguageSupport.GetItem("Dialog.CloseCase.ValidationErrorRoleAndPersonEmpty"));
|
_errors.Add(propertyName, cMultiLanguageSupport.GetItem("Dialog.CloseCase.ValidationErrorRoleAndPersonEmpty"));
|
||||||
|
|||||||
@@ -20,15 +20,22 @@
|
|||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.CloseTicket.ErrorType}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.CloseTicket.ErrorType}"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
||||||
<ComboBox x:Name="ErrorTypeComboBox"
|
<Border x:Name="ErrorTypeValidationBorder"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Margin="0 5 0 0"
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}"
|
BorderThickness="1"
|
||||||
SelectedItem="{Binding ElementName=CloseTicketDialogUc, Path=SelectedErrorType, Mode=TwoWay}"
|
Padding="1"
|
||||||
Margin="0 5 0 0"
|
CornerRadius="7.5"
|
||||||
DropDownOpened="DropDownOpened"
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
DropDownClosed="DropDownClosed"
|
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
||||||
PreviewKeyDown="ErrorTypeComboBox_PreviewKeyDown"
|
<ComboBox x:Name="ErrorTypeComboBox"
|
||||||
/>
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
SelectionChanged="ErrorTypeComboBox_SelectionChanged"
|
||||||
|
DropDownOpened="DropDownOpened"
|
||||||
|
DropDownClosed="DropDownClosed"
|
||||||
|
PreviewKeyDown="ErrorTypeComboBox_PreviewKeyDown" />
|
||||||
|
</Border>
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.CloseTicket.Solution}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.CloseTicket.Solution}"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}"
|
Foreground="{DynamicResource FontColor.Menu.Categories}"
|
||||||
|
|||||||
@@ -23,6 +23,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
public partial class CloseTicketDialog : UserControl
|
public partial class CloseTicketDialog : UserControl
|
||||||
{
|
{
|
||||||
|
private static readonly Brush ValidationBrush = CreateValidationBrush();
|
||||||
|
private static Brush CreateValidationBrush()
|
||||||
|
{
|
||||||
|
var brush = new SolidColorBrush(Color.FromRgb(0xF5, 0x7C, 0x73));
|
||||||
|
if (brush.CanFreeze)
|
||||||
|
brush.Freeze();
|
||||||
|
return brush;
|
||||||
|
}
|
||||||
|
private Brush defaultErrorTypeBorderBrush;
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public event EventHandler ErrorTypeValueChanged;
|
public event EventHandler ErrorTypeValueChanged;
|
||||||
@@ -72,7 +81,18 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
DependencyProperty.Register("SelectedErrorType", typeof(ComboBoxItem), typeof(CloseTicketDialog), new PropertyMetadata(null, OnSelectedErrorTypeChanged));
|
DependencyProperty.Register("SelectedErrorType", typeof(ComboBoxItem), typeof(CloseTicketDialog), new PropertyMetadata(null, OnSelectedErrorTypeChanged));
|
||||||
private static void OnSelectedErrorTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static void OnSelectedErrorTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var control = (CloseTicketDialog)d;
|
if (!(d is CloseTicketDialog control))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var newItem = e.NewValue as ComboBoxItem;
|
||||||
|
bool hasError = newItem == null || newItem.Tag == null;
|
||||||
|
|
||||||
|
if (control.ErrorTypeComboBox != null && !Equals(control.ErrorTypeComboBox.SelectedItem, newItem))
|
||||||
|
{
|
||||||
|
control.ErrorTypeComboBox.SelectedItem = newItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
control.UpdateErrorTypeValidationState(hasError);
|
||||||
control.ErrorTypeValueChanged?.Invoke(control, EventArgs.Empty);
|
control.ErrorTypeValueChanged?.Invoke(control, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +102,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
public CloseTicketDialog()
|
public CloseTicketDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
defaultErrorTypeBorderBrush = ErrorTypeValidationBorder?.BorderBrush?.CloneCurrentValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitialized(EventArgs e)
|
protected override void OnInitialized(EventArgs e)
|
||||||
@@ -176,5 +197,30 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
DropDownClosed(sender, e);
|
DropDownClosed(sender, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ErrorTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var selected = ErrorTypeComboBox?.SelectedItem as ComboBoxItem;
|
||||||
|
|
||||||
|
if (!Equals(SelectedErrorType, selected))
|
||||||
|
{
|
||||||
|
SelectedErrorType = selected;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hasError = selected == null || selected.Tag == null;
|
||||||
|
UpdateErrorTypeValidationState(hasError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateErrorTypeValidationState(bool hasError)
|
||||||
|
{
|
||||||
|
if (ErrorTypeValidationBorder == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (defaultErrorTypeBorderBrush == null)
|
||||||
|
defaultErrorTypeBorderBrush = ErrorTypeValidationBorder.BorderBrush?.CloneCurrentValue();
|
||||||
|
|
||||||
|
ErrorTypeValidationBorder.BorderBrush = hasError ? ValidationBrush : defaultErrorTypeBorderBrush;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,21 +19,35 @@
|
|||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
||||||
|
|
||||||
<local:ComboBoxPageable x:Name="RoleSelectionControl"
|
<Border x:Name="RoleValidationBorder"
|
||||||
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedRole, Mode=TwoWay}"
|
Margin="0 5 0 10"
|
||||||
Margin="0 5 0 10"
|
BorderThickness="1"
|
||||||
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Padding="1"
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}" />
|
CornerRadius="7.5"
|
||||||
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
||||||
|
<local:ComboBoxPageable x:Name="RoleSelectionControl"
|
||||||
|
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedRole, Mode=TwoWay}"
|
||||||
|
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
BorderBrush="Transparent" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ForwardTicket.ResponsiblePerson}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ForwardTicket.ResponsiblePerson}"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
||||||
|
|
||||||
<local:ComboBoxPageable x:Name="PersonSelectionControl"
|
<Border x:Name="PersonValidationBorder"
|
||||||
Margin="0 5 0 10"
|
Margin="0 5 0 10"
|
||||||
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedPerson, Mode=TwoWay}"
|
BorderThickness="1"
|
||||||
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Padding="1"
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}" />
|
CornerRadius="7.5"
|
||||||
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
||||||
|
<local:ComboBoxPageable x:Name="PersonSelectionControl"
|
||||||
|
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedPerson, Mode=TwoWay}"
|
||||||
|
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
|
BorderBrush="Transparent" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ForwardTicket.Comment}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ForwardTicket.Comment}"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
using static C4IT.Logging.cLogManager;
|
using static C4IT.Logging.cLogManager;
|
||||||
|
|
||||||
namespace FasdDesktopUi.Basics.UserControls
|
namespace FasdDesktopUi.Basics.UserControls
|
||||||
@@ -14,6 +15,17 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
public partial class ForwardTicketDialog : UserControl
|
public partial class ForwardTicketDialog : UserControl
|
||||||
{
|
{
|
||||||
private readonly cSupportCaseDataProvider _dataProvider;
|
private readonly cSupportCaseDataProvider _dataProvider;
|
||||||
|
private static readonly Brush ValidationBrush = CreateValidationBrush();
|
||||||
|
private static Brush CreateValidationBrush()
|
||||||
|
{
|
||||||
|
var brush = new SolidColorBrush(Color.FromRgb(0xF5, 0x7C, 0x73));
|
||||||
|
if (brush.CanFreeze)
|
||||||
|
brush.Freeze();
|
||||||
|
return brush;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Brush defaultRoleBorderBrush;
|
||||||
|
private Brush defaultPersonBorderBrush;
|
||||||
|
|
||||||
string lastPersonSearch = string.Empty;
|
string lastPersonSearch = string.Empty;
|
||||||
string lastRoleSearch = string.Empty;
|
string lastRoleSearch = string.Empty;
|
||||||
@@ -75,6 +87,9 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_dataProvider = dataProvider;
|
_dataProvider = dataProvider;
|
||||||
|
defaultRoleBorderBrush = RoleValidationBorder?.BorderBrush?.CloneCurrentValue();
|
||||||
|
defaultPersonBorderBrush = PersonValidationBorder?.BorderBrush?.CloneCurrentValue();
|
||||||
|
UpdateResponsibleSelectionValidationState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitialized(EventArgs e)
|
protected override void OnInitialized(EventArgs e)
|
||||||
@@ -192,5 +207,29 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateResponsibleSelectionValidationState(bool hasError)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (RoleValidationBorder != null)
|
||||||
|
{
|
||||||
|
if (defaultRoleBorderBrush == null)
|
||||||
|
defaultRoleBorderBrush = RoleValidationBorder.BorderBrush?.CloneCurrentValue();
|
||||||
|
RoleValidationBorder.BorderBrush = hasError ? ValidationBrush : defaultRoleBorderBrush;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PersonValidationBorder != null)
|
||||||
|
{
|
||||||
|
if (defaultPersonBorderBrush == null)
|
||||||
|
defaultPersonBorderBrush = PersonValidationBorder.BorderBrush?.CloneCurrentValue();
|
||||||
|
PersonValidationBorder.BorderBrush = hasError ? ValidationBrush : defaultPersonBorderBrush;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user