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

ShowAsPopupAsync broken in Avalonia 11.1.0 #185

Open
SCLD-ARowe opened this issue Jul 23, 2024 · 11 comments
Open

ShowAsPopupAsync broken in Avalonia 11.1.0 #185

SCLD-ARowe opened this issue Jul 23, 2024 · 11 comments

Comments

@SCLD-ARowe
Copy link

Hi, after upgrading to Avalonia 11.1.0 the ShowAsPopupAsync() method is no longer working as expected. When displayed it no longer grays out the screen behind it nor does it prevent a user from interacting with that screen. It also sometimes displays with the text behind it overlayed on top of the popup.

None of these were issues with 11.0.11. It's only after the latest upgrade. ShowWindowDialogAsync is working as expected, so I am using that instead for now.

@CreateLab
Copy link
Member

fixeed here #182

@SCLD-ARowe
Copy link
Author

Is this in a released version? I'm still having the same issues using MessageBox 3.1.6 with both Avalonia 11.1.0 and 11.1.1.

@filipnavara
Copy link

I can confirm it still happens on browser with Avalonia 11.1.1 and MessageBox 3.1.6.

@TheRealEamonCS
Copy link

TheRealEamonCS commented Aug 12, 2024

This issue also occurs on my Android app (both emulator and hardware) using the very latest Avalonia 11.1.2 and MessageBox 3.1.6. ShowWindowDialogAsync works as expected on the Windows/Linux/MacOS app versions but ShowAsPopupAsync displays a transparent non-modal popup in both light and dark modes. Hopefully nobody minds if I attach a light mode image.

TransparentAndroidPopup

Copy link

This issue also occurs on my Android app (both emulator and hardware) using the very latest Avalonia 11.1.2 and MessageBox 3.1.6. ShowWindowDialogAsync works as expected on the Windows/Linux/MacOS app versions but ShowAsPopupAsync displays a transparent non-modal popup in both light and dark modes. Hopefully nobody minds if I attach a light mode image.

TransparentAndroidPopup

usercontrol background=white

@EishaV
Copy link

EishaV commented Aug 28, 2024

@Upanc Sorry please explain "usercontrol background=white"

A workaround is to manipulate the UserControl via styles. But that's not pretty!

  <Application.Styles>
    <FluentTheme DensityStyle="Compact"/>
    <Style Selector=":is(UserControl)[Padding=15]">
      <Setter Property="Background" Value="{DynamicResource Box}"/>
    </Style>
  </Application.Styles>
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Light">
          <SolidColorBrush x:Key='Box'>White</SolidColorBrush>
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
          <SolidColorBrush x:Key='Box'>Black</SolidColorBrush>
        </ResourceDictionary>
      </ResourceDictionary.ThemeDictionaries>
    </ResourceDictionary>
  </Application.Resources>

(UserControl of MsBoxStandardView is the only one with padding 15 ;-)

Copy link

@Upanc Sorry please explain "usercontrol background=white"

A workaround is to manipulate the UserControl via styles. But that's not pretty!

  <Application.Styles>
    <FluentTheme DensityStyle="Compact"/>
    <Style Selector=":is(UserControl)[Padding=15]">
      <Setter Property="Background" Value="{DynamicResource Box}"/>
    </Style>
  </Application.Styles>
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Light">
          <SolidColorBrush x:Key='Box'>White</SolidColorBrush>
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
          <SolidColorBrush x:Key='Box'>Black</SolidColorBrush>
        </ResourceDictionary>
      </ResourceDictionary.ThemeDictionaries>
    </ResourceDictionary>
  </Application.Resources>

(UserControl of MsBoxStandardView is the only one with padding 15 ;-)

here MsBoxCustomView.axaml,It's useful to me

@EishaV
Copy link

EishaV commented Aug 28, 2024

I haven't found any examples or Wiki of how to use Custom.
I just want to use MsBox Standard from the nuget package without any adjustments and not manipulate the source code.

What does your solution look like in the code?

Copy link

I haven't found any examples or Wiki of how to use Custom. I just want to use MsBox Standard from the nuget package without any adjustments and not manipulate the source code.

What does your solution look like in the code?

clone this project and build

@TheRealEamonCS
Copy link

TheRealEamonCS commented Sep 2, 2024

@Upanc, @EishaV: Thank you both for the feedback, this is good stuff, I'll fiddle with it and see if I can resolve the issue. If I can get it working, I'll post my solution.

@sedwick2048
Copy link

sedwick2048 commented Sep 30, 2024

I got ShowWindowDialogAsync to do the job, although I don't know how to hide the title bar buttons:

        var box = MessageBoxManager.GetMessageBoxStandard("Not Implemented", "Opening of sensitivity parameters\nis not yet implemented.", ButtonEnum.Ok);
        var result = box.ShowWindowDialogAsync(TopLevel.GetTopLevel(this) as Window);

image

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

No branches or pull requests

7 participants