feat: update to finish functionality, start to build theme.

This commit is contained in:
rabbitism
2023-06-23 02:46:37 +08:00
parent bacf1a6330
commit c21e571b74
7 changed files with 475 additions and 62 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Avalonia;
using Avalonia.Controls.Shapes;
using Avalonia.Data.Converters;
using Avalonia.Media;
using Avalonia.Metadata;
namespace Ursa.Demo.Converters;
public class IconNameConverter: IValueConverter
{
[Content]
public Dictionary<string, PathGeometry> Paths { get; set; } = new();
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is null) return null;
if (value is string s)
{
return Paths.TryGetValue(s, out var path)? path: AvaloniaProperty.UnsetValue;
}
return AvaloniaProperty.UnsetValue;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}