Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
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.300
Anything else?
No response
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
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
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
Anything else?
No response