private void LoadData() { list = support_func.GetTableFiles(id); if (list.Count != 0) { ListAdapter = new ListViewAdapter(this, list); List_Files.Adapter = ListAdapter; info_text.Text = string.Empty; } else { List_Files.SetAdapter(null); info_text.Text = "Добавите файл"; } }
public override bool OnOptionsItemSelected(IMenuItem item) { var id = item.ItemId; if (id == Resource.Id.menu_name_file) { list = list.OrderByDescending(u => u.FileName).ToList(); } else if (id == Resource.Id.menu_size) { list = list.OrderByDescending(u => u.FileSize).ToList(); } else if (id == Resource.Id.menu_time) { list = list.OrderByDescending(u => DateTime.ParseExact(u.FileDate, "dd.MM.yyyy", null)).ToList(); } ListAdapter = new ListViewAdapter(this, list); List_Files.Adapter = ListAdapter; Toast.MakeText(this, "Сортировка по: " + item.TitleFormatted, ToastLength.Short).Show(); return(base.OnOptionsItemSelected(item)); }