AvaloniaUtils / DialogHost.Avalonia

AvaloniaUI control that provides a simple way to display a dialog with information or prompt the user when information is needed
MIT License
228 stars 15 forks source link

Compatibility with Avalonia 11.1? #48

Closed Numpsy closed 2 months ago

Numpsy commented 2 months ago

Hi,

While testing with https://github.com/danipen/TextMateSharp/issues/57#issuecomment-2037832212 in the Avalonia 11.1 previews, I noticed that an about box using DialogHost.Avalonia didn't work correctly - the dialog appeared but didn't disappear when closed, just hung about over the top of the background.

As a test I tried updating the demo application from this repository to the Avalonia 11.1 Beta 1 release and saw there are problems there as well dh

There are also some warnings in the debugger output:

[Binding]An error occurred binding 'OverlayBackground' to '': 'Could not convert 'DialogHostDemo.ViewModels.MainWindowViewModel' (DialogHostDemo.ViewModels.MainWindowViewModel) to 'Avalonia.Media.IBrush'.' (DialogHost #25747420)
[Binding]An error occurred binding 'Background' to '': 'Could not convert 'DialogHostDemo.ViewModels.MainWindowViewModel' (DialogHostDemo.ViewModels.MainWindowViewModel) to 'Avalonia.Media.IBrush'.' (DialogHost #25747420)

Thanks.

SKProCH commented 2 months ago

So, currently seems like my custom binding for getting colors from different themes doesn't work with updated binding system from avalonia 11.1.

As for workaround you can set values to this properties (Background, OverlayBackground) by youself.

I've currently trying to figure out how to adapt to new avalonia binding system.

SKProCH commented 2 months ago

Details can found here: https://github.com/AvaloniaUI/Avalonia/issues/15270

Numpsy commented 2 months ago

Thanks, my own application is working now with the new update.