/// <summary> /// Load ComboBox Items from API /// </summary> private async void LoadComboBoxItems() { // Activate ProgressSpinner and Show progress text LoadingProgress.IsActive = true; txtLoadingProgress.Text = "Loading values..."; //Load Values to Vehicle Class Combobox VehicleClasses = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VAjoneuvoluokka); cbVehicleClass.ItemsSource = VehicleClasses; cbVehicleClass.SelectedValuePath = "Value"; cbVehicleClass.DisplayMemberPath = "Value"; // Disable ProgressSpinner and Show progress text LoadingProgress.IsActive = false; txtLoadingProgress.Text = ""; }
/// <summary> /// Load ComboBox Items from API /// </summary> private async void LoadComboBoxItems() { // Activate ProgressSpinner and Show progress text LoadingProgress.IsActive = true; txtLoadingProgress.Text = "Loading values..."; //Retrieve data to Color combobox vColor = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VVari); cbColor.ItemsSource = vColor; cbColor.SelectedValuePath = "Value"; cbColor.DisplayMemberPath = "Value"; //Retrieve data to FuelType combobox vFuelType = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VKayttovoima); cbFuelType.ItemsSource = vFuelType; cbFuelType.SelectedValuePath = "Value"; cbFuelType.DisplayMemberPath = "Value"; //Retrieve data to FrameType combobox vFrameType = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VKorityyppi); cbFrameType.ItemsSource = vFrameType; cbFrameType.SelectedValuePath = "Value"; cbFrameType.DisplayMemberPath = "Value"; //Retrieve data to County combobox vCounty = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VKunta); cbCounty.ItemsSource = vCounty; cbCounty.SelectedValuePath = "Value"; cbCounty.DisplayMemberPath = "Value"; //Retrieve data to Car Class combobox vCarClass = await VehicleAPI.GetOptionsAsync(QueryBuilder.Table.VAjoneuvoluokka); cbCarClass.ItemsSource = vCarClass; cbCarClass.SelectedValuePath = "Value"; cbCarClass.DisplayMemberPath = "Value"; // Disable ProgressSpinner and Show progress text LoadingProgress.IsActive = false; txtLoadingProgress.Text = ""; }