using AyCode.Blazor.Components;
using DevExpress.Blazor;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAM.Entities.TransferDestinations;
using TIAMWebApp.Shared.Application.Interfaces;
using TIAMWebApp.Shared.Application.Models;

namespace TIAMSharedUI.Pages
{
    public partial class ChooseDestination : ComponentBase
    {
        [Parameter]
        public string DestinationId
        {
            get;
            set;
        }
        public IEnumerable<TransferDestination> TransferDestinations
        {
            get;
            set;
        }
        [Inject]
        public ITransferDataService TransferDataService
        {
            get;
            set;
        }
        [Parameter]
        public string Value
        {
            get;
            set;
        }
        [Parameter]
        public EventCallback<string> ValueChanged
        {
            get;
            set;
        }
        protected override async Task OnInitializedAsync()
        {
            TransferDestinations = (await TransferDataService.GetDestinationsAsync()).ToList();
        }
        private Task OnValueChanged(ChangeEventArgs e)
        {
            Value = e.Value.ToString();
            DisplayCard();
            return ValueChanged.InvokeAsync(Value);
        }

        private void DisplayCard()
        {

        }
    }
}


