public MainViewModel() { InitMenu(); this.rentmodel = new CategoryListModelMVC(); var vm = new CategoryListModelMVC(); this.RentItems = new ObservableCollection <CategoryModelMVC>(vm.Categories); var vmCars = new CarListModelMVC(); this.CarsItems = new ObservableCollection <CarModelMVC>(vmCars.Cars); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create your application here SetContentView(Resource.Layout.CarList); var vm = new CarListModelMVC(); var list = (ListView)FindViewById(Resource.Id.mainList); var adapter = new Custom.CarsAdapter(this, vm.Cars); list.Adapter = adapter; var array = vm.Cars.ToArray(); list.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var item = array[e.Position]; this.NavigateTo(item.BuyPage); }; }