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

DialogHost not shown when Dialog Content contains ListBox #35

Closed
Mrxx99 opened this issue Aug 3, 2023 · 9 comments · Fixed by AvaloniaCommunity/MessageBox.Avalonia#155
Labels
bug Something isn't working

Comments

@Mrxx99
Copy link
Contributor

Mrxx99 commented Aug 3, 2023

I have a minimal sample project where the DialogHost content contains a ListBox and a Button, when the ListBox is there the Dialog is not shown, if the ListBox is not there the Dialog is shown properly.

You can check with the project AvaloniaMatrixInvertIssue_v11 here:
https://github.com/Mrxx99/AvaloniaDialogHostAndAsyncImageLoaderIssue

Just lunch the project and click the "Show Dialog" button -> dialog will not show
then stop, remove or replace the ListBox and try again -> now it will work

(you can ignore the other projects and the async image loader in the repo as there was initial an issue when both were used together with avalonia 11 preview6)

@SKProCH SKProCH added the bug Something isn't working label Aug 3, 2023
@Bip901
Copy link

Bip901 commented Aug 5, 2023

Just experienced the same issue - System.InvalidOperationException is thrown with the message "Transform is not invertible".

This issue is new to the Avalonia 11 release.

Here's a minimal project to reproduce the issue - just run and click the button:

avaloniatest.zip

Screenshot:

Screenshot 2023-08-05 141849

@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

When I click the button in all above examples here, I didn't get any exception, seems like because of this weird issue: AvaloniaUI/Avalonia#12388

I'll try to investigate it, but currently I doesn't know how.

@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

@Bip901, can you provide an full exception details (or at least stacktrace)?

@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

Seems like setting DisableOpeningAnimation="True" for DialogHost will prevent this from appearing.

@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

Also, seems like this is related to VirualizingStackPanel, since if we change it to something else (e.g. StackPanel), this works fine:

<ListBox>
  <ListBox.ItemsPanel>
    <ItemsPanelTemplate>
      <VirtualizingStackPanel></VirtualizingStackPanel>
    </ItemsPanelTemplate>
  </ListBox.ItemsPanel>
  <ListBoxItem>test</ListBoxItem>
</ListBox>
@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

Fixed with the workaround.

@SKProCH
Copy link
Member

SKProCH commented Aug 5, 2023

Will be available as v0.7.6 on nuget in near future.

@Bip901
Copy link

Bip901 commented Aug 6, 2023

Awesome, quick fix and detailed explanation - thank you!

Note that I also experienced a hang rather than an exception - I just noticed an InvalidOperationException in the logs so I changed the Visual Studio settings to break on InvalidOperationException. Since it occurs on a background thread, I could resume debugging and also observe that the app keeps running in a frozen state.

@SKProCH
Copy link
Member

SKProCH commented Aug 6, 2023

Strange, but if I set an exception breakpoints in Rider, it doesn't trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants