private void LoadData() { list_name_category = support_func.GetTabelCategory(); if (list_name_category.Count != 0) { ListAdapter = new ListViewCategoryAdapter(this, list_name_category); List_Category.Adapter = ListAdapter; info_text.Text = string.Empty; } else { List_Category.SetAdapter(null); info_text.Text = "Создайте новую категорию"; } }
public override bool OnOptionsItemSelected(IMenuItem item) { var id = item.ItemId; if (id == Resource.Id.menu_name_category) { list_name_category = list_name_category.OrderByDescending(u => u.Category).ToList(); } else if (id == Resource.Id.menu_count) { list_name_category = list_name_category.OrderByDescending(u => u.Count).ToList(); } ListAdapter = new ListViewCategoryAdapter(this, list_name_category); List_Category.Adapter = ListAdapter; Toast.MakeText(this, "Сортировка по: " + item.TitleFormatted, ToastLength.Short).Show(); return(base.OnOptionsItemSelected(item)); }