-
Notifications
You must be signed in to change notification settings - Fork 480
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
When I have my popup registered as transient Service.AddTransientPopup<MyPopup, MyViewModel>(), and try to show the popup using PopupService.ShowPopupAsync(...) - viewmodel behind is created twice.
Attaching sample empty app which helps to reproduce the issue.
Expected Behavior
When I show the popup using PopupService.ShowPopupAsync(...) - I expect single view and viewmodel to be created to serve this call.
Steps To Reproduce
- Open attached solution
- Click default Click me button which navigates you to next Page
- Click on Open Popup
In debug you can observe that constructor for ViewModel has been called twice.
Link to public reproduction project repository
https://github.com/vyefymochkyn/maui-popup-issue
Environment
- .NET MAUI CommunityToolkit: 12.3
dotnet --version
9.0.306
Installed Workload Id Manifest Version Installation Source
---------------------------------------------------------------------
android 35.0.105/9.0.100 SDK 9.0.300
ios 26.0.9752/9.0.100 SDK 9.0.300
maui 9.0.111/9.0.100 SDK 9.0.300
maui-maccatalyst 9.0.111/9.0.100 SDK 9.0.300Anything else?
No response
Reactions are currently unavailable