I have a custom list with structure category -id -name -color I create a list and bind it to combobox name categoryListBox in my xaml page.
I have tried using this piece of code
List<category> categoryCollection = await categoryList.GetCategoryListAsync();
categoryListBox.ItemsSource = categoryCollection;
categoryListBox.DisplayMemberPath = "name";
categoryListBox.SelectedValuePath = "id";
using this as resource
Whenever I run the app, all I get is a blank screen, although when I get collection of items using
var item = categoryListBox.Items;
it shows it of type System.Generic.Lists having the number of items it should have. I seem to be on a standstill here, and don't know whats wrong with it. I even looked at an example, but couldn't understand much.
This is the definition of combobox
<ComboBox
Canvas.ZIndex="100"
Name="categoryListBox"
Foreground="Black"
Margin="10,0"
PlaceholderText="Select.."
Style="{StaticResource ComboBoxStyle1}"/>