As title, I am using collection view and wanna make default select but it don't show properly.
below is my partial code:
this doesn't work, the first element didn't highlight
CategoryCollection.ItemsSource = _categoryRepository.Get(); // list of object
CategoryCollection.SelectedItem = _categoryRepository.Get()[0];
this can work, the first element was highlight(selected):
var temp = _categoryRepository.Get();
CategoryCollection.ItemsSource = temp ;
CategoryCollection.SelectedItem = temp[0];
I have tried override object equal function and operator ==, both don't work.