Closed Mrxx99 closed 10 months ago
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:
Screenshot:
When I click the button in all above examples here, I didn't get any exception, seems like because of this weird issue: https://github.com/AvaloniaUI/Avalonia/issues/12388
I'll try to investigate it, but currently I doesn't know how.
@Bip901, can you provide an full exception details (or at least stacktrace)?
Seems like setting DisableOpeningAnimation="True"
for DialogHost
will prevent this from appearing.
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>
Fixed with the workaround.
Will be available as v0.7.6 on nuget in near future.
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.
Strange, but if I set an exception breakpoints in Rider, it doesn't trigger.
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)