Question Details

No question body available.

Tags

c# dependency-injection popup maui maui-community-toolkit

Answers (1)

April 20, 2026 Score: 1 Rep: 101 Quality: Low Completeness: 50%

I found a way to achieve what I want. For every ViewModel I also create a subclass of PickerBottomSheet now and register it explicitly.

builder.Services.AddTransientPopup();
builder.Services.AddTransientPopup();
public partial class PickerBottomSheet : Popup
{
    public PickerBottomSheet(PickerBottomSheetViewModel vm)
    {
        BindingContext = vm;
        InitializeComponent();
    }
}
public sealed partial class BaitPickerBottomSheet : PickerBottomSheet
{
    public BaitPickerBottomSheet(BaitPickerViewModel vm) : base(vm) { }
}

I'll mark this as answer for now, if anyone has a better way feel free to share :)