Gelb einfärben der Zeile der Meldeklasse im Overview, wenn PAS und Passagier Anzahl > 0
This commit is contained in:
parent
66c96daa92
commit
3010d783f1
@ -8,6 +8,7 @@
|
|||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:util="clr-namespace:ENI2.Util"
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:data="clr-namespace:bsmd.database;assembly=bsmd.database"
|
||||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="800">
|
d:DesignHeight="300" d:DesignWidth="800">
|
||||||
@ -147,6 +148,13 @@
|
|||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="LightYellow" />
|
<Setter Property="Background" Value="LightYellow" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
|
<MultiDataTrigger>
|
||||||
|
<MultiDataTrigger.Conditions>
|
||||||
|
<Condition Binding="{Binding Path=Elements, Converter={util:CutoffConverter}, ConverterParameter=0}" Value="True" />
|
||||||
|
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PAS}" />
|
||||||
|
</MultiDataTrigger.Conditions>
|
||||||
|
<Setter Property="Background" Value="Yellow" />
|
||||||
|
</MultiDataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.RowStyle>
|
</DataGrid.RowStyle>
|
||||||
@ -161,9 +169,6 @@
|
|||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<!--
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationGroup}" Binding="{Binding ENINotificationDetailGroup}" IsReadOnly="True" Width="0.25*" />
|
|
||||||
-->
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}"
|
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}"
|
||||||
IsReadOnly="True" Width="0.075*" FontWeight="Bold">
|
IsReadOnly="True" Width="0.075*" FontWeight="Bold">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
|||||||
@ -436,6 +436,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Util\BoolToVisibilityConverter.cs" />
|
<Compile Include="Util\BoolToVisibilityConverter.cs" />
|
||||||
<Compile Include="Util\ByteConverter.cs" />
|
<Compile Include="Util\ByteConverter.cs" />
|
||||||
|
<Compile Include="Util\CutoffConverter.cs" />
|
||||||
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
|
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
|
||||||
<Compile Include="Util\EnumHelper.cs" />
|
<Compile Include="Util\EnumHelper.cs" />
|
||||||
<Compile Include="Util\EnumToBooleanConverter.cs" />
|
<Compile Include="Util\EnumToBooleanConverter.cs" />
|
||||||
|
|||||||
49
ENI2/Util/CutoffConverter.cs
Normal file
49
ENI2/Util/CutoffConverter.cs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// Copyright (c) 2023- schick Informatik
|
||||||
|
// Description: Simple converter to check if a numeric value is greater than a specific value. This can
|
||||||
|
// be used by datatriggers in XAML
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Markup;
|
||||||
|
|
||||||
|
namespace ENI2.Util
|
||||||
|
{
|
||||||
|
public class CutoffConverter : MarkupExtension, IValueConverter
|
||||||
|
{
|
||||||
|
|
||||||
|
#region MarkupExtension implementation
|
||||||
|
|
||||||
|
private static CutoffConverter _converter = null;
|
||||||
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
if (_converter == null)
|
||||||
|
{
|
||||||
|
_converter = new CutoffConverter();
|
||||||
|
}
|
||||||
|
return _converter;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IValueConverter implementation
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (value is ICollection collection)
|
||||||
|
return collection.Count > Cutoff;
|
||||||
|
return ((int)value) > Cutoff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public int Cutoff { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user