mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-25 16:05:26 +00:00
Fix nullability mismatch in WPF converters
This commit is contained in:
@@ -9,15 +9,20 @@ public class DateTimeOffsetToDateTimeConverter : IValueConverter
|
||||
{
|
||||
public static DateTimeOffsetToDateTimeConverter Instance { get; } = new();
|
||||
|
||||
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
||||
public object? Convert(
|
||||
object? value,
|
||||
Type targetType,
|
||||
object? parameter,
|
||||
CultureInfo culture
|
||||
) =>
|
||||
value is DateTimeOffset dateTimeOffsetValue
|
||||
? dateTimeOffsetValue.DateTime
|
||||
: default(DateTime?);
|
||||
|
||||
public object? ConvertBack(
|
||||
object value,
|
||||
object? value,
|
||||
Type targetType,
|
||||
object parameter,
|
||||
object? parameter,
|
||||
CultureInfo culture
|
||||
) =>
|
||||
value is DateTime dateTimeValue
|
||||
|
||||
Reference in New Issue
Block a user