Flow.Launcher/Flow.Launcher.Avalonia/Views/ResultListBox.axaml.cs
Hongtao Zhang 4120407ac3 Add initial Avalonia UI project for migration
Create Flow.Launcher.Avalonia project as foundation for migrating from WPF to Avalonia UI framework.

Key components:
- MainWindow with query box and results list (matching WPF layout)
- ViewModels: MainViewModel, ResultsViewModel, ResultViewModel
- Themes/Base.axaml with converted styles from WPF
- FluentAvaloniaUI for Windows 11 styling
- References existing Core/Infrastructure/Plugin projects

The project builds and runs alongside the existing WPF application.
This is Phase 1 of the incremental migration approach.
2026-01-14 23:01:35 -08:00

34 lines
829 B
C#

using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
namespace Flow.Launcher.Avalonia.Views;
public partial class ResultListBox : UserControl
{
private ListBox? _listBox;
public ResultListBox()
{
InitializeComponent();
_listBox = this.FindControl<ListBox>("ResultsList");
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
base.OnPointerPressed(e);
// Handle left click on result item
var point = e.GetCurrentPoint(this);
if (point.Properties.IsLeftButtonPressed)
{
// The ListBox handles selection automatically
// Additional click handling can be added here
}
}
}