-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBreakRangeToBooleanConverterTime
More file actions
42 lines (25 loc) · 1.18 KB
/
BreakRangeToBooleanConverterTime
File metadata and controls
42 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class BreakRangeToBooleanConverterTime : IValueConverter
{
public static readonly TimeSpan _toCompare = new TimeSpan(00, 15, 00);
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is TimeSpan))
return DependencyProperty.UnsetValue;
return (TimeSpan)value > _toCompare;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new Exception("To Long On Break");
}
}
<DataGrid.Resources>
<local:BreakRangeToBooleanConverterTime x:Key="Breakconvtime"/>
</DataGrid.Resources>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding AuxReasons}" Value="Break"/>
<Condition Binding="{Binding Time, Converter={StaticResource Breakconvtime}}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="Red"/>
<Setter Property="Background" Value="SkyBlue"/>
</MultiDataTrigger>