mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
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.
34 lines
829 B
C#
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
|
|
}
|
|
}
|
|
}
|