Cleanup GUI

This commit is contained in:
Oleksii Holub
2022-04-01 00:10:17 +03:00
parent 3a2b119618
commit 1daff4178d
15 changed files with 254 additions and 201 deletions

View File

@@ -9,19 +9,13 @@ public class TimeSpanToDateTimeConverter : IValueConverter
{
public static TimeSpanToDateTimeConverter Instance { get; } = new();
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is TimeSpan timeSpanValue)
return DateTime.Today.Add(timeSpanValue);
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
value is TimeSpan timeSpanValue
? DateTime.Today.Add(timeSpanValue)
: default(DateTime?);
return default(DateTime?);
}
public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is DateTime dateTimeValue)
return dateTimeValue.TimeOfDay;
return default(TimeSpan?);
}
public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
value is DateTime dateTimeValue
? dateTimeValue.TimeOfDay
: default(TimeSpan?);
}