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
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace TheXamlGuy.UI.WPF;
public static class EventArgsExtensions
{
public static dynamic? GetEventArguments(this EventArgs args, string? path, IValueConverter? converter, object? converterParameter)
{
if (path is { Length: > 0 })
{
if (GetEventArgsPropertyPathValue(args, path) is object value)
{
if (converter is not null)
{
return converter.Convert(value, typeof(object), converterParameter, CultureInfo.CurrentCulture);
}
return value;
}
}
return args;
}
private static object GetEventArgsPropertyPathValue(object args, string path)
{
object? value = args;
if (path is { })
{
value = PropertyPathHelper.GetValue(args, path);
}
return value;
}
}