Wrap FluentAvalonia controls within same named classes allowing us to declare the xmlns namespace in our assembly

This commit is contained in:
Daniel Clark
2022-12-10 15:52:58 +00:00
parent 3d9a7e4438
commit 4f243eba2e
94 changed files with 121 additions and 85 deletions
@@ -0,0 +1,28 @@
using Avalonia;
using Avalonia.Data;
namespace Toolkit.Foundation.Avalonia
{
public static class PropertyPathHelper
{
private static readonly Dummy dummy = new();
public static object GetValue(object args, string path)
{
Binding binding = new(path)
{
Mode = BindingMode.OneTime,
Source = args
};
dummy.Bind(Dummy.ValueProperty, binding);
return dummy.GetValue(Dummy.ValueProperty);
}
private class Dummy : AvaloniaObject
{
public static readonly StyledProperty<object> ValueProperty =
AvaloniaProperty.Register<Dummy, object>("Value");
}
}
}