This commit is contained in:
PrefacedCorg
2026-04-13 01:40:39 +08:00
parent c255db6ff3
commit 57c3fe358b
2 changed files with 26 additions and 0 deletions
+24
View File
@@ -2,6 +2,7 @@
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace Ink_Canvas.Converter
{
@@ -152,4 +153,27 @@ namespace Ink_Canvas.Converter
return null;
}
}
public class StringToGeometryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
try
{
if (value is string geometryString && !string.IsNullOrEmpty(geometryString))
{
return Geometry.Parse(geometryString);
}
}
catch (Exception)
{
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}