Files
Speckle.Material.Icons.Aval…/Material.Icons.Avalonia/GeometryConverter.cs
T
2021-02-06 20:49:15 +03:00

21 lines
637 B
C#

using System;
using System.Globalization;
using Avalonia.Data;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace Material.Icons.Avalonia {
public class GeometryConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
if (value is string s) {
return Geometry.Parse(s);
}
return BindingOperations.DoNothing;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
throw new NotSupportedException();
}
}
}