protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.servicios_Mantenedor); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarMantenedorServicios); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.Title = "Servicios"; mostrarSnackBar = Intent.GetStringExtra("origen") == "reserva"; listViewServicios = FindViewById <ListView>(Resource.Id.listServicios); listViewServicios.ItemClick += ListViewServicios_ItemClick; listViewServicios.ItemLongClick += ListViewServicios_ItemLongClick; textBusquedaServicio = FindViewById <EditText>(Resource.Id.textBuscarServicio); textBusquedaServicio.TextChanged += TextBusquedaServicio_TextChanged; db = new SQLite.SQLiteConnection(sqlPath); servicios = db.Table <MServicio1>().OrderBy(x => x.Titulo).ToList(); //ventas = db.Table<MVenta>().OrderBy(x => x.FechaEmision).ToList(); var ventasAdapter = new ServicioAdapter(this, servicios); listViewServicios.Adapter = ventasAdapter; listViewServicios.FastScrollEnabled = true; Window.SetSoftInputMode(SoftInput.StateHidden); }
private void TextBusquedaServicio_TextChanged(object sender, Android.Text.TextChangedEventArgs e) { var aux = servicios.Where(x => x.Titulo.ToUpper().Contains(textBusquedaServicio.Text.ToUpper())).ToList(); var ventasAdapter = new ServicioAdapter(this, aux); listViewServicios.Adapter = ventasAdapter; ventasAdapter.NotifyDataSetChanged(); }