You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
417 B
20 lines
417 B
12 months ago
|
using Avalonia.Input;
|
||
|
|
||
|
namespace StabilityMatrix.Avalonia.Extensions;
|
||
|
|
||
|
public static class DataObjectExtensions
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Get Context from IDataObject, set by Xaml Behaviors
|
||
|
/// </summary>
|
||
|
public static T? GetContext<T>(this IDataObject dataObject)
|
||
|
{
|
||
|
if (dataObject.Get("Context") is T context)
|
||
|
{
|
||
|
return context;
|
||
|
}
|
||
|
|
||
|
return default;
|
||
|
}
|
||
|
}
|