diff --git a/src/Ursa.Themes.Semi/Controls/Timeline.axaml b/src/Ursa.Themes.Semi/Controls/Timeline.axaml
index d0dc9f9..98631f7 100644
--- a/src/Ursa.Themes.Semi/Controls/Timeline.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Timeline.axaml
@@ -22,14 +22,6 @@
-
-
diff --git a/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs b/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
index f172fe9..aee4eaf 100644
--- a/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
@@ -3,14 +3,15 @@ using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class BooleansToOpacityConverter: IValueConverter
+public class BooleansToOpacityConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is bool b)
{
- return b? 1.0: 0.0;
+ return b ? 1.0 : 0.0;
}
+
return 1;
}
diff --git a/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs b/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
index 13f072c..a13d426 100644
--- a/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
@@ -4,7 +4,7 @@ using Avalonia.Media;
namespace Ursa.Themes.Semi.Converters;
-public class BrushToColorConverter: IValueConverter
+public class BrushToColorConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
@@ -12,6 +12,7 @@ public class BrushToColorConverter: IValueConverter
{
return b.Color;
}
+
return Colors.Transparent;
}
diff --git a/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
index 68e890a..30c47d2 100644
--- a/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
@@ -5,7 +5,7 @@ namespace Ursa.Themes.Semi.Converters;
public class ClockHandLengthConverter(double ratio) : IValueConverter
{
- public static ClockHandLengthConverter Hour { get; } = new(1-0.618);
+ public static ClockHandLengthConverter Hour { get; } = new(1 - 0.618);
public static ClockHandLengthConverter Minute { get; } = new(0.618);
public static ClockHandLengthConverter Second { get; } = new(1);
@@ -15,6 +15,7 @@ public class ClockHandLengthConverter(double ratio) : IValueConverter
{
return d * ratio / 2;
}
+
return 0.0;
}
diff --git a/src/Ursa.Themes.Semi/Converters/CornerRadiusTakeConverter.cs b/src/Ursa.Themes.Semi/Converters/CornerRadiusTakeConverter.cs
deleted file mode 100644
index 6ce9156..0000000
--- a/src/Ursa.Themes.Semi/Converters/CornerRadiusTakeConverter.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.Globalization;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Data.Converters;
-
-namespace Ursa.Themes.Semi.Converters;
-
-[Obsolete("This converter is deprecated. Use CornerRadiusMixerConverter instead.")]
-public class CornerRadiusTakeConverter: IValueConverter
-{
- private readonly Dock _dock;
- internal CornerRadiusTakeConverter(Dock dock)
- {
- _dock = dock;
- }
- public static CornerRadiusTakeConverter Left { get; } = new(Dock.Left);
- public static CornerRadiusTakeConverter Top { get; } = new(Dock.Top);
- public static CornerRadiusTakeConverter Right { get; } = new(Dock.Right);
- public static CornerRadiusTakeConverter Bottom { get; } = new(Dock.Bottom);
-
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- if(value is not CornerRadius c) return AvaloniaProperty.UnsetValue;
- return _dock switch
- {
- Dock.Left => new CornerRadius(c.TopLeft, 0, 0, c.BottomLeft),
- Dock.Top => new CornerRadius(c.TopLeft, c.TopRight, 0, 0),
- Dock.Right => new CornerRadius(0, c.TopRight, c.BottomRight, 0),
- Dock.Bottom => new CornerRadius(0, 0, c.BottomRight, c.BottomLeft),
- _ => AvaloniaProperty.UnsetValue
- };
- }
-
- public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs b/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs
index 30db804..a881640 100644
--- a/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs
@@ -1,11 +1,10 @@
using System.Globalization;
-using Avalonia.Controls;
using Avalonia.Data.Converters;
using Avalonia.Layout;
namespace Ursa.Themes.Semi.Converters;
-public class FormContentHeightToAlignmentConverter: IValueConverter
+public class FormContentHeightToAlignmentConverter : IValueConverter
{
public static FormContentHeightToAlignmentConverter Instance = new(32);
public double Threshold { get; set; }
@@ -14,18 +13,18 @@ public class FormContentHeightToAlignmentConverter: IValueConverter
{
Threshold = 32;
}
-
+
// ReSharper disable once ConvertToPrimaryConstructor
// Justification: need to keep the default constructor for XAML
public FormContentHeightToAlignmentConverter(double threshold)
{
Threshold = threshold;
}
-
-
+
+
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
- if(value is not double d) return VerticalAlignment.Center;
+ if (value is not double d) return VerticalAlignment.Center;
return d > Threshold ? VerticalAlignment.Top : VerticalAlignment.Center;
}
diff --git a/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs b/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
index 43be772..239f078 100644
--- a/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
@@ -4,7 +4,7 @@ using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class FormContentHeightToMarginConverter: IValueConverter
+public class FormContentHeightToMarginConverter : IValueConverter
{
public static FormContentHeightToMarginConverter Instance = new();
public double Threshold { get; set; }
@@ -13,17 +13,17 @@ public class FormContentHeightToMarginConverter: IValueConverter
{
Threshold = 32;
}
-
+
// ReSharper disable once ConvertToPrimaryConstructor
// Justification: need to keep the default constructor for XAML
public FormContentHeightToMarginConverter(double threshold)
{
Threshold = threshold;
}
-
+
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
- if(value is not double d) return new Thickness(0);
+ if (value is not double d) return new Thickness(0);
return d > Threshold ? new Thickness(0, 8, 8, 0) : new Thickness(0, 0, 8, 0);
}
diff --git a/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs b/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
index 89e851b..92e14e8 100644
--- a/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
@@ -4,14 +4,15 @@ using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class NavMenuMarginConverter: IMultiValueConverter
+public class NavMenuMarginConverter : IMultiValueConverter
{
public object? Convert(IList