Multi-Platform Package Manager for Stable Diffusion
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.

26 lines
641 B

using System.Diagnostics;
using Avalonia.Input;
using Avalonia.Interactivity;
using StabilityMatrix.Avalonia.Controls;
namespace StabilityMatrix.Avalonia.Extensions;
public static class VisualExtensions
{
[Conditional("DEBUG")]
public static void AttachDebugSaveScreenshot(this AppWindowBase visual)
{
visual.AddDisposableHandler(
InputElement.KeyDownEvent,
(s, e) =>
{
if (new KeyGesture(Key.F10).Matches(e))
{
App.DebugSaveScreenshot();
}
},
RoutingStrategies.Tunnel
);
}
}