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
253 stars 16 forks source link

Background, Blackout Screen, and CloseOnClickAway Do Not Work on Mobile #66

Open anose001 opened 5 days ago

anose001 commented 5 days ago

The left side on the picture below shows the Dialog as it should be displayed with a white background and the blackout screen overlayed over the rest of the screen on desktop. The right side shows the mobile case where neither the background nor the overlayed blackout screen display. CloseOnClickAway="True" does not work on mobile but works on desktop. The logic connected to the viewmodels works properly.

Issue3

anose001 commented 5 days ago

On desktop Background and OverlayBackgroundproperties have default values White and Black. This is not the case for mobile. Setting Background="White" and OverlayBackground="Black" explicitly fixes the above issues, including the CloseOnClickAway as the background is now clickable.

SKProCH commented 5 days ago

Its actually doesn't have White and Black values, it searches for this resources:

    <Setter Property="OverlayBackground"
            Value="{utilities:MultiDynamicResource DefaultBrush=Black, ResourceKeys=SystemControlBackgroundBaseHighBrush}" />
    <Setter Property="Background"
            Value="{utilities:MultiDynamicResource DefaultBrush=Black, ResourceKeys=SystemControlBackgroundAltHighBrush;MaterialDesignPaper;MaterialPaperBrush}">

Probably by some conditions it will doesn't find it on mobile. Does this reproduceable in blank project with Fluent theme only?

anose001 commented 5 days ago

I have not been using th FluentTheme by default, maybe this is where this issue stems from. I would have to set it up first and then test it

SKProCH commented 5 days ago

If it reproduceable with Fluent theme its a valid bug and should be fixed.

anose001 commented 5 days ago

@SKProCH , I added the Fluent theme package and added the style to my app settings and the background and blackout screen do not behave as expected. I guess the above is a quick workaround for this.