Skip to content

fix(avalonia): pass bool x:True for NTFS preset CommandParameter - #2170

Merged
Mbucari merged 1 commit into
rmcrackan:masterfrom
wtanksleyjr:fix/edit-replacement-chars-bool-param
Nov 18, 2026
Merged

Mbucari merged 1 commit into
rmcrackan:masterfrom
wtanksleyjr:fix/edit-replacement-chars-bool-param

Conversation

@wtanksleyjr

Copy link
Copy Markdown
Contributor

Fixes #2095.

Cause

In EditReplacementChars.axaml, the three NTFS preset buttons (Defaults, LoFiDefaults, Barebones) passed CommandParameter="True", which XAML evaluates as a System.String. Because Defaults(bool isNtfs), LoFiDefaults(bool isNtfs), and Barebones(bool isNtfs) take a bool, Avalonia's compiled-binding CommandExecuteTrampoline threw System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Boolean'.

Fix

Change CommandParameter="True" to CommandParameter="{x:True}" on those three buttons.

Testing

  • dotnet build Source/LibationAvalonia/LibationAvalonia.csproj --no-restore: 0 warnings, 0 errors.

@Mbucari
Mbucari merged commit dbb705a into rmcrackan:master Nov 18, 2026
12 checks passed
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.

Crash while applying NTFS character replacement presets - InvalidCastException

2 participants