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.

44 lines
1.1 KiB

using Avalonia.Input;
using Avalonia.Markup.Xaml;
using FluentAvalonia.UI.Controls;
using StabilityMatrix.Avalonia.Controls;
using StabilityMatrix.Avalonia.ViewModels;
namespace StabilityMatrix.Avalonia.Views;
public partial class InferencePage : UserControlBase
{
public InferencePage()
{
InitializeComponent();
AddHandler(DragDrop.DropEvent, DropHandler);
AddHandler(DragDrop.DragOverEvent, DragOverHandler);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void TabView_OnTabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
(DataContext as InferenceViewModel)?.OnTabCloseRequested(args);
}
private void DragOverHandler(object? sender, DragEventArgs e)
{
if (DataContext is IDropTarget dropTarget)
{
dropTarget.DragOver(sender, e);
}
}
private void DropHandler(object? sender, DragEventArgs e)
{
if (DataContext is IDropTarget dropTarget)
{
dropTarget.Drop(sender, e);
}
}
}