diff --git a/src/Avalonia.Base/Media/Geometry.cs b/src/Avalonia.Base/Media/Geometry.cs
index e2b345df1a..e62f819b74 100644
--- a/src/Avalonia.Base/Media/Geometry.cs
+++ b/src/Avalonia.Base/Media/Geometry.cs
@@ -8,7 +8,7 @@ namespace Avalonia.Media
///
/// Defines a geometric shape.
///
- [TypeConverter(typeof(GeometryConverter))]
+ [TypeConverter(typeof(GeometryTypeConverter))]
public abstract class Geometry : AvaloniaObject
{
///
@@ -203,7 +203,7 @@ namespace Avalonia.Media
}
}
- public class GeometryConverter : TypeConverter
+ public class GeometryTypeConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
{
diff --git a/tests/Avalonia.Markup.Xaml.UnitTests/Converters/GeometryTypeConverterTests.cs b/tests/Avalonia.Markup.Xaml.UnitTests/Converters/GeometryTypeConverterTests.cs
new file mode 100644
index 0000000000..329a14afa6
--- /dev/null
+++ b/tests/Avalonia.Markup.Xaml.UnitTests/Converters/GeometryTypeConverterTests.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Avalonia.Controls;
+using Avalonia.Controls.Shapes;
+using Avalonia.Media;
+using Avalonia.UnitTests;
+using Xunit;
+
+namespace Avalonia.Markup.Xaml.UnitTests.Converters
+{
+ public class GeometryTypeConverterTests: XamlTestBase
+ {
+ public class StringDataViewModel
+ {
+ public string PathData { get; set; }
+ }
+
+ public class IntDataViewModel
+ {
+ public int PathData { get; set; }
+ }
+
+
+ [Theory]
+ [MemberData(nameof(Get_GeometryTypeConverter_Data))]
+ public void GeometryTypeConverter_Value_Work(object vm, bool nullData)
+ {
+ using(UnitTestApplication.Start(TestServices.StyledWindow))
+ {
+ var xaml = @"
+
+
+";
+ var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml);
+ var path = window.FindControl("path");
+ window.DataContext = vm;
+ Assert.Equal(nullData, path.Data is null);
+ }
+ }
+
+ public static IEnumerable