Exemple #1
0
        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);
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            SetContentView(Resource.Layout.CarList);

            var vm   = new CategoryListModelMVC();
            var list = (ListView)FindViewById(Resource.Id.mainList);

            var adapter = new Custom.CategoryiesAdapter(this, vm.Categories);

            list.Adapter = adapter;

            var array = vm.Categories.ToArray();

            list.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                var item = array[e.Position];
                this.NavigateTo(item.RentPage);
            };
        }