@page "/transfer"
@using TIAMSharedUI.Pages.Components
@using TIAMSharedUI.Shared
@using TIAMWebApp.Shared.Application.Interfaces
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
@using TIAMWebApp.Shared.Application.Utility
@inject NavigationManager navManager
@inject LogToBrowserConsole logToBrowserConsole
@inject IWizardProcessor WizardProcessor
<PageTitle>Transfer</PageTitle>

    <HeroSlider></HeroSlider>
<div class="container" style="position: relative; z-index: 2;">
    <div class="row d-flex justify-content-center">
        <div class="col-12 col-lg-6">
            <div class="card bg-white p-3">
                <InputWizard Data=@myModel 
                OnSubmit="SubmitForm" 
                IgnoreReflection="@TransferIgnorList" 
                SubmitButtonText="ButtonSend" 
                TitleResourceString="TransferTitle"
            SubtitleResourceString="TransferSubtitle"></InputWizard>
      

            </div>
        </div>
    </div>
    
</div>





@code {
    public TransferWizardModel myModel = new TransferWizardModel();

    public List<string> TransferIgnorList = new List<string>
    {
       "Id",
       "Price",
       "Driver"
    };    

    /*protected override void OnAfterRender(bool isFirst)
        {
        message = " Target destination is " + slider.SliderElementId.ToString();
    }*/    

    public async Task SubmitForm(object Result)
    {
        var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result);
        logToBrowserConsole.LogToBC($"Submitted nested form: {Result.GetType().FullName}");
        navManager.NavigateTo("/transfer2/"+transfer.Id);
    }

     
   

}

