diff --git a/DeFRaG_Helper/App.xaml b/DeFRaG_Helper/App.xaml
index 7daa918..05a33b3 100644
--- a/DeFRaG_Helper/App.xaml
+++ b/DeFRaG_Helper/App.xaml
@@ -13,6 +13,8 @@
+
+
diff --git a/DeFRaG_Helper/Converters/BoolToVisibilityConverter.cs b/DeFRaG_Helper/Converters/BoolToVisibilityConverter.cs
index e697a06..b988859 100644
--- a/DeFRaG_Helper/Converters/BoolToVisibilityConverter.cs
+++ b/DeFRaG_Helper/Converters/BoolToVisibilityConverter.cs
@@ -1,9 +1,5 @@
-using System;
-using System.Collections.Generic;
+using System.Diagnostics;
using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
@@ -13,15 +9,45 @@ public class BoolToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- // Assuming the value is a boolean and targetType is Visibility
- bool isVisible = (bool)value;
+ bool isVisible;
+
+ if (value is int intValue)
+ {
+ isVisible = intValue != 0; // Treat non-zero integers as true
+ }
+ else if (value is bool boolValue)
+ {
+ isVisible = boolValue;
+ }
+ else
+ {
+ throw new InvalidOperationException("Unsupported type");
+ }
+
+ bool invert = parameter != null && bool.Parse((string)parameter);
+
+ if (invert) isVisible = !isVisible;
+
return isVisible ? Visibility.Visible : Visibility.Collapsed;
}
+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- // ConvertBack is not necessary for this use case
- throw new NotImplementedException();
+ if (value is bool boolValue)
+ {
+ // Convert boolean back to integer (0 or 1) for SQLite storage.
+ return boolValue ? 1 : 0;
+ }
+ else
+ {
+ throw new ArgumentException("Expected value to be of type Boolean", nameof(value));
+ }
}
+
+
+
+
}
+
}
diff --git a/DeFRaG_Helper/Converters/IntToBoolConverter.cs b/DeFRaG_Helper/Converters/IntToBoolConverter.cs
new file mode 100644
index 0000000..b55ef7a
--- /dev/null
+++ b/DeFRaG_Helper/Converters/IntToBoolConverter.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace DeFRaG_Helper.Converters
+{
+ public class IntToBoolConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ // Assuming 1 represents true/favorite, and 0 (or null) represents false/not favorite
+ return value is int intValue && intValue == 1;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ // Convert back to integer representation for the database
+ return value is bool boolValue && boolValue ? 1 : 0;
+ }
+ }
+}
diff --git a/DeFRaG_Helper/CustomStyles.xaml b/DeFRaG_Helper/CustomStyles.xaml
index 398c80b..1caa895 100644
--- a/DeFRaG_Helper/CustomStyles.xaml
+++ b/DeFRaG_Helper/CustomStyles.xaml
@@ -817,16 +817,48 @@
+
+
+
+
+
+
+
-