Skip to content

Migrate GUI from WPF to Avalonia for cross-platform support#82

Open
deadlydog wants to merge 2 commits intomainfrom
migrate-wpf-to-avalonia
Open

Migrate GUI from WPF to Avalonia for cross-platform support#82
deadlydog wants to merge 2 commits intomainfrom
migrate-wpf-to-avalonia

Conversation

@deadlydog
Copy link
Copy Markdown
Owner

Summary

Converts the PathLengthCheckerGUI project from WPF (.NET Framework 4.5.2) to Avalonia 11.2 targeting net8.0, making the application runnable on Windows, macOS, and Linux.

Changes

PathLengthCheckerGUI (complete rewrite)

Old (WPF) New (Avalonia)
App.xaml / App.xaml.cs App.axaml / App.axaml.cs
MainWindow.xaml / MainWindow.xaml.cs MainWindow.axaml / MainWindow.axaml.cs
Extended.WPF.Toolkit SplitButton Avalonia built-in SplitButton + Flyout
Extended.WPF.Toolkit IntegerUpDown Avalonia built-in NumericUpDown
WinForms.FolderBrowserDialog StorageProvider.OpenFolderPickerAsync
System.Windows.Clipboard TopLevel.Clipboard
Properties.Settings.Default (app.config) AppSettings.cs — JSON file in %APPDATA%
ApplicationSettingsBindingExtension Direct ViewModel bindings
WPF.MessageBox.Show MessageBoxHelper (custom Avalonia Window)
Code-behind only MVVM: MainWindowViewModel + code-behind
WPF DependencyProperty Standard INPC properties

New files:

  • Program.cs — Avalonia AppBuilder entry point
  • AppSettings.cs — Cross-platform JSON settings persistence
  • MessageBoxHelper.cs — Lightweight dialog helper using native Avalonia controls
  • ViewModels/MainWindowViewModel.cs — All search state and business logic

PathLengthChecker (core library)

  • Migrated from legacy .csproj to SDK-style targeting net8.0
  • Replaced AlphaFS with System.IO.EnumerationOptions (IgnoreInaccessible = true, AttributesToSkip = ReparsePoint) — removes a Windows-only dependency

PathLengthChecker.Tests

  • Migrated from legacy .csproj to SDK-style targeting net8.0
  • Updated xunit and FluentAssertions to current versions
  • Fixed File.Create() without .Close() that caused test cleanup failures on .NET 8

All projects: SDK-style csproj, net8.0

Verified

  • All 15 unit tests pass
  • Solution builds cleanly (dotnet build)

deadlydog and others added 2 commits March 30, 2026 17:25
- Replace PathLengthCheckerGUI WPF project with Avalonia 11.2 equivalent
  - New App.axaml/cs, MainWindow.axaml/cs using Avalonia APIs
  - New Program.cs Avalonia entry point with AppBuilder
  - MainWindowViewModel (MVVM pattern with INotifyPropertyChanged)
  - AppSettings.cs: JSON-based settings replacing Properties.Settings.Default
  - MessageBoxHelper.cs: cross-platform dialog built on Avalonia primitives
  - SplitButton + Flyout replaces Extended.WPF.Toolkit SplitButton
  - NumericUpDown replaces Extended.WPF.Toolkit IntegerUpDown
  - StorageProvider.OpenFolderPickerAsync replaces WinForms FolderBrowserDialog
  - TopLevel.Clipboard replaces WPF Clipboard
  - Process.Start with UseShellExecute for cross-platform file explorer open

- Migrate all projects from .NET Framework 4.5.2 legacy csproj to SDK-style
  targeting net8.0

- Replace AlphaFS dependency with System.IO.EnumerationOptions
  (IgnoreInaccessible + AttributesToSkip = ReparsePoint)

- Fix test fixture: close FileStream from File.Create() to prevent
  cleanup failures on .NET 8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Gitoffthelawn
Copy link
Copy Markdown
Contributor

Avalonia? I loved her singing on Prince's Purple Rain album.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants