Need Help
please give me full solution
i am creating a Xamarin Form Page and there is Picker Control in my page .
i want to display a list in picker.and data is coming from the API. after that i am trying to Bind API Data with my Picker Control
My Problem is that
i am able to fetch the data but only single value is displaying only. only one value not complete list.
i am sending my codes which i am trying to do
GetAircraftCustomerDetails
this method is for API and result is coming from the API properly
please check full of codes and reply to me soon
What I have tried:
This is UI
<Picker x:Name="selectAircraft" Title="--Select--" ItemDisplayBinding="{Binding AircraftModel,Mode=TwoWay}" ItemsSource="{Binding aircraft}">
public async void GetAirCraftRegin()
{
if (!Util.CheckInternet())
{
return;
}
InputClass = new NRCMainInput();
AircraftRegnList = new ObservableCollection<List<RootResultData>>();
aircraft = new List<aircraftDetail>();
WorkOrderApiHelper _workOrderApiHelper = new WorkOrderApiHelper();
InputClass.OUID = 1;
InputClass.AIRCRAFT_REG_NO = "123231";
string Result = await _workOrderApiHelper.GetAircraftCustomerDetails(InputClass);
if (!string.IsNullOrEmpty(Result))
{
var objdata = JsonConvert.DeserializeObject<RootResultData>(Result);
foreach (var items in objdata.Result.ModelCust)
{
aircraftDetail details = new aircraftDetail();
details.AircraftModel = items.AircraftModel;
aircraft.Add(details);
selectAircraft.ItemsSource = aircraft;
}
}
}
internal async Task<string> GetAircraftCustomerDetails(NRCMainInput InputClass)
{
ServiceProcess _Service = new ServiceProcess();
var ReqString = Newtonsoft.Json.JsonConvert.SerializeObject(InputClass);
var result = await _Service.CommonPostAsync(URLConstants.NEWNRCAirCraft + "?AIRCRAFT_REG_NO="+ InputClass.AIRCRAFT_REG_NO + "&OUID=" + InputClass.OUID,ReqString);
return result;
}