diff --git a/src/Ursa.Themes.Semi/Controls/Anchor.axaml b/src/Ursa.Themes.Semi/Controls/Anchor.axaml
index 7d388ee..4682cbc 100644
--- a/src/Ursa.Themes.Semi/Controls/Anchor.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Anchor.axaml
@@ -4,7 +4,6 @@
xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters">
-
@@ -51,7 +50,7 @@
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}">
-
+
diff --git a/src/Ursa.Themes.Semi/Controls/Badge.axaml b/src/Ursa.Themes.Semi/Controls/Badge.axaml
index 3a7175d..f94bd6e 100644
--- a/src/Ursa.Themes.Semi/Controls/Badge.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Badge.axaml
@@ -28,8 +28,6 @@
-
-
@@ -85,7 +83,7 @@
TextElement.Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding HeaderTemplate}">
-
+
diff --git a/src/Ursa.Themes.Semi/Controls/IconButton.axaml b/src/Ursa.Themes.Semi/Controls/IconButton.axaml
index 0ad3eec..34efef8 100644
--- a/src/Ursa.Themes.Semi/Controls/IconButton.axaml
+++ b/src/Ursa.Themes.Semi/Controls/IconButton.axaml
@@ -29,7 +29,6 @@
-
@@ -75,7 +74,7 @@
ContentTemplate="{TemplateBinding IconTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Foreground="{Binding #PART_ContentPresenter.Foreground}"
- Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={StaticResource OpacityConverter}}">
+ Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={converters:BooleansToOpacityConverter}}">
-
@@ -29,8 +28,8 @@
-
-
+
+
diff --git a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml
index f3645ad..96955bd 100644
--- a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml
+++ b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml
@@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters">
-
@@ -67,7 +66,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
-
+
diff --git a/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs b/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
index aee4eaf..8524756 100644
--- a/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/BooleansToOpacityConverter.cs
@@ -1,11 +1,11 @@
using System.Globalization;
-using Avalonia.Data.Converters;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class BooleansToOpacityConverter : IValueConverter
+public class BooleansToOpacityConverter : MarkupValueConverter
{
- public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is bool b)
{
@@ -14,9 +14,4 @@ public class BooleansToOpacityConverter : IValueConverter
return 1;
}
-
- 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/BrushToColorConverter.cs b/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
index a13d426..7f61b24 100644
--- a/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/BrushToColorConverter.cs
@@ -1,12 +1,12 @@
using System.Globalization;
-using Avalonia.Data.Converters;
using Avalonia.Media;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class BrushToColorConverter : IValueConverter
+public class BrushToColorConverter : MarkupValueConverter
{
- public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is ISolidColorBrush b)
{
@@ -15,9 +15,4 @@ public class BrushToColorConverter : IValueConverter
return Colors.Transparent;
}
-
- 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/ClockHandLengthConverter.cs b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
index 30c47d2..7b2b7d9 100644
--- a/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs
@@ -1,15 +1,15 @@
using System.Globalization;
-using Avalonia.Data.Converters;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class ClockHandLengthConverter(double ratio) : IValueConverter
+public class ClockHandLengthConverter(double ratio) : MarkupValueConverter
{
public static ClockHandLengthConverter Hour { get; } = new(1 - 0.618);
public static ClockHandLengthConverter Minute { get; } = new(0.618);
public static ClockHandLengthConverter Second { get; } = new(1);
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is double d)
{
@@ -18,9 +18,4 @@ public class ClockHandLengthConverter(double ratio) : IValueConverter
return 0.0;
}
-
- 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 a881640..a41e763 100644
--- a/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/FormContentHeightToAlignmentConverter.cs
@@ -1,10 +1,10 @@
using System.Globalization;
-using Avalonia.Data.Converters;
using Avalonia.Layout;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class FormContentHeightToAlignmentConverter : IValueConverter
+public class FormContentHeightToAlignmentConverter : MarkupValueConverter
{
public static FormContentHeightToAlignmentConverter Instance = new(32);
public double Threshold { get; set; }
@@ -21,15 +21,9 @@ public class FormContentHeightToAlignmentConverter : IValueConverter
Threshold = threshold;
}
-
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is not double d) return VerticalAlignment.Center;
return d > Threshold ? VerticalAlignment.Top : VerticalAlignment.Center;
}
-
- 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/FormContentHeightToMarginConverter.cs b/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
index 239f078..3a11de8 100644
--- a/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/FormContentHeightToMarginConverter.cs
@@ -1,10 +1,10 @@
using System.Globalization;
using Avalonia;
-using Avalonia.Data.Converters;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class FormContentHeightToMarginConverter : IValueConverter
+public class FormContentHeightToMarginConverter : MarkupValueConverter
{
public static FormContentHeightToMarginConverter Instance = new();
public double Threshold { get; set; }
@@ -21,14 +21,9 @@ public class FormContentHeightToMarginConverter : IValueConverter
Threshold = threshold;
}
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
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);
}
-
- 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/NavMenuMarginConverter.cs b/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
index 92e14e8..d8e4be9 100644
--- a/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
+++ b/src/Ursa.Themes.Semi/Converters/NavMenuMarginConverter.cs
@@ -1,12 +1,12 @@
using System.Globalization;
using Avalonia;
-using Avalonia.Data.Converters;
+using Irihi.Avalonia.Shared.Converters;
namespace Ursa.Themes.Semi.Converters;
-public class NavMenuMarginConverter : IMultiValueConverter
+public class NavMenuMarginConverter : MarkupMultiValueConverter
{
- public object? Convert(IList