Add project files.

This commit is contained in:
Daniel Clark
2022-11-01 15:26:08 +00:00
parent daa7b59f22
commit 7e4f880821
408 changed files with 16863 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
using System.Windows;
using System.Windows.Data;
namespace TheXamlGuy.UI.WPF
{
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
};
BindingOperations.SetBinding(dummy, Dummy.ValueProperty, binding);
return dummy.GetValue(Dummy.ValueProperty);
}
private class Dummy : DependencyObject
{
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(object), typeof(Dummy),
new UIPropertyMetadata(null));
}
}
}