public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var viewListInstrument = inflater.Inflate(Resource.Layout.fragment_instrument, container, false); var listView = viewListInstrument.FindViewById <ListView>(Resource.Id.listViewInstrument); _instrumentAdpter = new InstrumentAdapter(viewListInstrument.Context, _instrumentRepository.Get()); listView.Adapter = _instrumentAdpter; listView.ItemClick += ListView_ItemClick; listView.ItemLongClick += ListView_ItemLongClick; return(viewListInstrument); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var viewResume = inflater.Inflate(Resource.Layout.fragment_card, container, false); _textTotal = viewResume.FindViewById <TextView>(Resource.Id.txtResumoTotal); var listViewResume = viewResume.FindViewById <ListView>(Resource.Id.listViewResumo); _resumeAdapter = new ResumeAdapter(container.Context, _instrumentRepository.Get().Where(w => w.Count > 0).ToList()); listViewResume.Adapter = _resumeAdapter; Refresh(); return(viewResume); }
private void BtnClearCount_Click(object sender, System.EventArgs e) { var instrumentRepository = new InstrumentRepository(); var instruments = instrumentRepository.Get(); foreach (var instrument in instruments) { instrumentRepository.Delete(instrument); } instrumentRepository.AddDefaultInstrument(); }