@using TIAMWebApp.Shared.Application.Models @using TIAMWebApp.Shared.Application.Services @inject TourService TourService @inject IJSRuntime JSRuntime @inject NavigationManager NavigationManager

Tours

Please select!

@code { public List Tours = new List(); private bool _owlCarouselInitialized = false; protected override async Task OnInitializedAsync() { Tours = (await TourService.GetAllAsync()).ToList(); } protected override async Task OnAfterRenderAsync(bool firstRender) { // Only initialize Owl Carousel once, after data is loaded and rendered if (Tours != null && Tours.Any() && !_owlCarouselInitialized) { await JSRuntime.InvokeVoidAsync("initializeOwlCarousel"); _owlCarouselInitialized = true; // Set flag to true after successful initialization } } private void Book(Guid id, int category) { NavigationManager.NavigateTo($"/book-a-tour/{id.ToString()}/{category}"); } }