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
957 B
C#
34 lines
957 B
C#
using System;
|
|
using System.Globalization;
|
|
using Avalonia.Data.Converters;
|
|
|
|
namespace Flow.Launcher.Avalonia.Converters;
|
|
|
|
/// <summary>
|
|
/// Converts a boolean value to IsVisible (Avalonia uses bool for visibility, not Visibility enum)
|
|
/// </summary>
|
|
public class BoolToIsVisibleConverter : IValueConverter
|
|
{
|
|
/// <summary>
|
|
/// If true, inverts the boolean value (true becomes false, false becomes true)
|
|
/// </summary>
|
|
public bool Invert { get; set; }
|
|
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
if (value is bool boolValue)
|
|
{
|
|
return Invert ? !boolValue : boolValue;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
if (value is bool boolValue)
|
|
{
|
|
return Invert ? !boolValue : boolValue;
|
|
}
|
|
return false;
|
|
}
|
|
}
|