21 lines
637 B
C#
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();
|
|
}
|
|
}
|
|
} |