Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null & InvalidCastException binding errors when opening dialogs in demo #424

Open
1 task
moon6969 opened this issue Dec 28, 2024 · 0 comments
Open
1 task
Assignees
Labels
bug Something isn't working

Comments

@moon6969
Copy link

Usage Information

Material.Avalonia v3.9.1 / Avalonia 11.2.3 / Windows 11 10.0.22631

Description

Many binding errors when using DialogHelper.CreateAlertDialog().

Reproduction Steps

In VS2022 run the Material.Avalonia.Demo.Desktop app, go Dialogs → Standalone Dialog → Dialog with Confirmation.

Debug output shows errors (see Actual Behavior below).

Expected Behavior

No binding errors.

Actual Behavior

[Binding]An error occurred binding 'Text' to 'SelectedGroup.KindToCopy' at 'SelectedGroup': 'Value is null.' (TextBox #66697461)
[Binding]An error occurred binding 'Kind' to 'SelectedGroup.KindValue' at 'SelectedGroup': 'Value is null.' (MaterialIcon #24111608)
[Binding]An error occurred binding 'Width' to 'Width': 'Could not convert '(null)' (null) to 'System.Double'.' (DockPanel #PART_RootPanel)
[Binding]An error occurred binding 'MaxWidth' to 'MaxWidth': 'Could not convert '(null)' (null) to 'System.Double'.' (DockPanel #PART_RootPanel)
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
[Binding]An error occurred binding 'IsVisible' to '!!DialogIcon' at '!': 'Unable to convert 'Material.Dialog.ViewModels.Elements.Header.Icons.DialogIconViewModel' to bool.' (ContentPresenter #PART_HeaderIcon)
Exception thrown: 'System.InvalidCastException' in Material.Avalonia.Dialogs.dll
[Binding]An error occurred binding 'Content' to 'DialogIcon' at 'DialogIcon': 'Unable to cast object of type 'Material.Dialog.ViewModels.Elements.Header.Icons.DialogIconViewModel' to type 'Material.Dialog.ViewModels.DialogWindowViewModel'.' (ContentPresenter #PART_HeaderIcon)
Exception thrown: 'System.ArgumentOutOfRangeException' in Material.Avalonia.Dialogs.dll
[Binding]An error occurred binding 'Content' to 'DialogIcon' at 'DialogIcon': 'Specified argument was out of the range of valid values.' (ContentPresenter #PART_HeaderIcon)
Exception thrown: 'System.InvalidCastException' in Material.Avalonia.Dialogs.dll
[Binding]An error occurred binding 'IsVisible' to '!!DialogIcon' at 'DialogIcon': 'Unable to cast object of type 'Material.Dialog.ViewModels.Elements.Header.Icons.DialogIconViewModel' to type 'Material.Dialog.ViewModels.DialogWindowViewModel'.' (ContentPresenter #PART_HeaderIcon)

Regression?

Possibly related to #168

Known Workarounds

No response

Anything else?

No response

Could you help with a pull-request?

No

Is there an existing issue for this?

  • I have searched the existing issues
@moon6969 moon6969 added the bug Something isn't working label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants