41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using ClaudeDo.Ui.ViewModels;
|
|
|
|
namespace ClaudeDo.Ui.Views;
|
|
|
|
public partial class TaskListView : UserControl
|
|
{
|
|
public TaskListView()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnTaskItemDoubleTapped(object? sender, TappedEventArgs e)
|
|
{
|
|
if (sender is Control c && c.DataContext is TaskItemViewModel
|
|
&& DataContext is TaskListViewModel vm)
|
|
{
|
|
vm.EditTaskCommand.Execute(null);
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
|
|
private void OnTaskItemPointerPressed(object? sender, PointerPressedEventArgs e)
|
|
{
|
|
if (e.GetCurrentPoint(null).Properties.PointerUpdateKind == PointerUpdateKind.RightButtonPressed
|
|
&& sender is Control c && c.DataContext is TaskItemViewModel item
|
|
&& DataContext is TaskListViewModel vm)
|
|
{
|
|
vm.SelectedTask = item;
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
|
|
private void OnInlineAddKeyDown(object? sender, Avalonia.Input.KeyEventArgs e) { }
|
|
private void OnInlineAddGotFocus(object? sender, Avalonia.Interactivity.RoutedEventArgs e) { }
|
|
private void OnInlineAddLostFocus(object? sender, Avalonia.Interactivity.RoutedEventArgs e) { }
|
|
private void OnTaskListKeyDown(object? sender, Avalonia.Input.KeyEventArgs e) { }
|
|
private void OnCheckboxPressed(object? sender, Avalonia.Input.PointerPressedEventArgs e) { }
|
|
}
|