4,152 questions
You can run it on the viewmodel constructor with a Task.Run(async()=> await GetProductDetailAsync)
Or you can run in the OnAppearing. OnAppearing is an event so you can convert to a command using EventToCommandBehaviour in the CommunityToolkit.Maui
<ContentPage.Behaviors>
<mct:EventToCommandBehavior Command="{Binding AppearingCommand}" EventName="Appearing" />
<mct:EventToCommandBehavior Command="{Binding DisappearingCommand}" EventName="Disappearing" />
</ContentPage.Behaviors>