Repository navigation
Bind the main window to properties that exist - #1012
Merged
mnadareski merged 1 commit intoJul 12, 2026
Merged
Conversation
Two bindings in the main window name properties that MainViewModel does not have,
so they silently do nothing. Avalonia reports both at runtime:
[Binding]An error occurred binding 'Text' to 'StatusFirstLine':
Could not find a matching property accessor for 'StatusFirstLine'
on 'MPF.Frontend.ViewModels.MainViewModel'. (TextBlock #StatusLabel)
[Binding]An error occurred binding 'IsEnabled' to 'MediaTypeComboBoxEnabled':
Could not find a matching property accessor for 'MediaTypeComboBoxEnabled'
on 'MPF.Frontend.ViewModels.MainViewModel'. (ComboBox #MediaTypeComboBox)
StatusFirstLine only exists on CheckDumpViewModel, which is the data context of the
check dump window, not of the main window. The status field therefore stays empty for
the whole session; MainViewModel exposes the text as Status, which is what the WPF
main window already binds. With this change the field shows 'CD-ROM ready to dump'
again, as it does on WPF.
MediaTypeComboBoxEnabled was renamed to PhysicalMediaTypeComboBoxEnabled in the view
model, and both XAML files kept the old name. IsEnabled falls back to its default of
true, so the media type box stays usable while the view model wants it locked, which
includes the length of a dump. WPF is fixed as well: it only looks unaffected because
it reports binding errors to the debug trace rather than the log.
Reproduced on Fedora 44 (KDE) against the packaged 3.8.3 build.
mnadareski
approved these changes
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two bindings in the main window name properties that
MainViewModeldoes not have, so they silently do nothing. Avalonia reports both at runtime:(a) The status field stays empty.
MPF.Avalonia/Windows/MainWindow.axaml:344bindsStatusFirstLine, which only exists onCheckDumpViewModel(MPF.Frontend/ViewModels/CheckDumpViewModel.cs:159), the data context of the check dump window. The main window's data context isMainViewModel, which exposes the text asStatus(MPF.Frontend/ViewModels/MainViewModel.cs:451) — which is what the WPF main window already binds (MPF.UI/Windows/MainWindow.xaml:510). The status field therefore shows nothing for the whole session.(b) A rename that both XAML files missed. The view model property is
PhysicalMediaTypeComboBoxEnabled(MPF.Frontend/ViewModels/MainViewModel.cs:184), but the old name is still bound inMPF.Avalonia/Windows/MainWindow.axaml:211MPF.UI/Windows/MainWindow.xaml:355IsEnabledfalls back to its default oftrue, so the media type box stays usable while the view model wants it locked. That includes the length of a dump:MainViewModelsets the property tofalsewhen dumping starts and back totruewhen it ends. WPF only looks unaffected because it reports binding errors to the debug trace rather than to the log, so it is fixed here as well.Change
Bind to the properties that exist. After the change both warnings are gone and the status field reads "CD-ROM ready to dump", as it does on WPF.
Verified on Fedora 44 (KDE Plasma) against the packaged 3.8.3 build, with a trace listener attached so that Avalonia's binding warnings are visible: two warnings before, none after.
Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.