diff --git a/DiscordChatExporter.Gui/Converters/DateTimeOffsetToDateTimeConverter.cs b/DiscordChatExporter.Gui/Converters/DateTimeOffsetToDateTimeConverter.cs
index d5b9ef3..6ac4c84 100644
--- a/DiscordChatExporter.Gui/Converters/DateTimeOffsetToDateTimeConverter.cs
+++ b/DiscordChatExporter.Gui/Converters/DateTimeOffsetToDateTimeConverter.cs
@@ -11,18 +11,18 @@ namespace DiscordChatExporter.Gui.Converters
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value is DateTimeOffset date)
- return date.DateTime;
+ if (value is DateTimeOffset dateTimeOffsetValue)
+ return dateTimeOffsetValue.DateTime;
- return null;
+ return default;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value is DateTime date)
- return new DateTimeOffset(date);
+ if (value is DateTime dateTimeValue)
+ return new DateTimeOffset(dateTimeValue);
- return null;
+ return default;
}
}
}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs b/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs
index 9309cfd..33410e3 100644
--- a/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs
+++ b/DiscordChatExporter.Gui/Converters/ExportFormatToStringConverter.cs
@@ -12,10 +12,10 @@ namespace DiscordChatExporter.Gui.Converters
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value is ExportFormat format)
- return format.GetDisplayName();
+ if (value is ExportFormat exportFormatValue)
+ return exportFormatValue.GetDisplayName();
- return null;
+ return default;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/DiscordChatExporter.Gui/Converters/InverseBoolConverter.cs b/DiscordChatExporter.Gui/Converters/InverseBoolConverter.cs
new file mode 100644
index 0000000..30e2638
--- /dev/null
+++ b/DiscordChatExporter.Gui/Converters/InverseBoolConverter.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace DiscordChatExporter.Gui.Converters
+{
+ [ValueConversion(typeof(bool), typeof(bool))]
+ public class InverseBoolConverter : IValueConverter
+ {
+ public static InverseBoolConverter Instance { get; } = new InverseBoolConverter();
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is bool boolValue)
+ return !boolValue;
+
+ return default;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is bool boolValue)
+ return !boolValue;
+
+ return default;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
index 56d7cde..cc4db40 100644
--- a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
+++ b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj
@@ -61,6 +61,7 @@
+
diff --git a/DiscordChatExporter.Gui/ViewModels/Framework/DialogScreen.cs b/DiscordChatExporter.Gui/ViewModels/Framework/DialogScreen.cs
index c1da8c9..8cd090f 100644
--- a/DiscordChatExporter.Gui/ViewModels/Framework/DialogScreen.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Framework/DialogScreen.cs
@@ -6,7 +6,7 @@ namespace DiscordChatExporter.Gui.ViewModels.Framework
{
public T DialogResult { get; private set; }
- public void Close(T dialogResult = default(T))
+ public void Close(T dialogResult = default)
{
// Set the result
DialogResult = dialogResult;
diff --git a/DiscordChatExporter.Gui/Views/RootView.xaml b/DiscordChatExporter.Gui/Views/RootView.xaml
index 1772ea6..6363ae2 100644
--- a/DiscordChatExporter.Gui/Views/RootView.xaml
+++ b/DiscordChatExporter.Gui/Views/RootView.xaml
@@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="clr-namespace:DiscordChatExporter.Gui.Behaviors"
+ xmlns:converters="clr-namespace:DiscordChatExporter.Gui.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
@@ -124,7 +125,7 @@
Value="{Binding ProgressManager.Progress, Mode=OneWay}" />
-
+