I have ObservableCollection list and i want to sort it to alphabet for ex : when i enter 3 names (basketball , arab , club) the output : basketball, arab, club
and i want it like : arab, basketball, club,
this code for ObservableCollection :
public ObservableCollection<Contact> ContactList { get; set; }
and this code of Add and Delete items
public ContactsListView()
{
InitializeComponent();
ContactList = new ObservableCollection<Contact>();
BindingContext = new Contact();
MessagingCenter.Subscribe<Contact>(this, "addNew", (addItem) =>
{
ContactList.Add(new Contact { Name = addItem.Name, PhoneNo = addItem.PhoneNo, Address = addItem.Address, NickName = addItem.NickName });
});
MessagingCenter.Subscribe<Contact>(this, "deleteContact", (Account) =>
{
ContactList.Remove(Account);
});
MyListView.ItemsSource = ContactList;
AddNewContact.Clicked+= AddNewContact_Clicked;
}