@using System.Linq.Expressions @using AyCode.Core.Loggers @using AyCode.Services.Loggers @using TIAM.Core.Loggers @using TIAM.Entities.Transfers @using TIAM.Services @using TIAMSharedUI.Pages @using TIAMSharedUI.Pages.User.SysAdmins @using TIAMWebApp.Shared.Application.Interfaces @using TIAMWebApp.Shared.Application.Services @using TIAMWebApp.Shared.Application.Utility @inject IEnumerable LogWriters @inject AdminSignalRClient _adminSignalRClient @inject ITransferDataService TransferDataService @*

@GetSelectedItemDescription()

*@ @* *@ @code { [Parameter] public EventCallback OnSliderChanged { get; set; } [Parameter] public string TextValue { get; set; } = ""; [Parameter] public string CssClass { get; set; } = ""; public List Destinations = new List(); public DxTextBox TextField; TransferDestination Result; ILogger _logger; IEnumerable Data { get; set; } private TransferDestination _selectedDestination; public TransferDestination SelectedDestination { get => _selectedDestination; set { if (_selectedDestination != value) { _selectedDestination = value; SetNewDestination(value); } } } protected override void OnParametersSet() { } protected override async Task OnInitializedAsync() { _logger = new LoggerClient(LogWriters.ToArray()); Data = await _adminSignalRClient.GetAllAsync>(SignalRTags.GetAllTransferDestinations); _logger.Debug($"List length: {Data.Count().ToString()}"); SelectedDestination = Data.FirstOrDefault(); } // RenderFragment GetSelectedItemDescription() // { // if (SelectedDestination != null) // { // SetNewDestination(SelectedDestination); // return @ // Selected Item: ( // @GetFieldDescription(nameof(TransferDestination.Name), SelectedDestination.Name), // @GetFieldDescription(nameof(TransferDestination.AddressString), SelectedDestination.AddressString), // @GetFieldDescription(nameof(TransferDestination.Description), SelectedDestination.Description) // ) // ; // } // return @Selected Item: null; // } public void SetNewDestination(TransferDestination destination) { OnSliderChanged.InvokeAsync(destination.AddressString); } // RenderFragment GetFieldDescription(string fieldName, object value) // { // return @@fieldName: @value; // } }