Added Slop

This commit is contained in:
joel.leirer
2026-08-25 17:14:54 +02:00
commit fb1f90a9ca
151 changed files with 5870 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
using Avalonia.Controls;
using Avalonia.Input;
using Lagerprogramm.Models;
using Lagerprogramm.ViewModels;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace Lagerprogramm.Views;
public partial class DeductionSearchDialog : Window
{
public Deduction? SelectedDeduction { get; private set; }
public DeductionSearchDialog()
{
InitializeComponent();
KeyDown += OnKeyDown;
}
public async Task<Deduction?> ShowDeductionSearch(ObservableCollection<Deduction> deductions, Window parent)
{
SelectedDeduction = null;
var viewModel = new DeductionSearchDialogViewModel(deductions);
DataContext = viewModel;
await ShowDialog(parent);
return SelectedDeduction;
}
private void OnDoubleTapped(object? sender, TappedEventArgs e)
{
if (DeductionListBox.SelectedItem is Deduction deduction)
{
SelectedDeduction = deduction;
Close();
}
}
private void OnKeyDown(object? sender, KeyEventArgs e)
{
if (e.Key == Key.Enter && DeductionListBox.SelectedItem is Deduction deduction)
{
SelectedDeduction = deduction;
Close();
}
}
}