Пример #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var customer = (CustomerViewModel)e.Parameter;

            App.CurrentCustomerId = customer.Id;
            projectsViewModel     = new ProjectsViewModel();
            projects = projectsViewModel.GetProjects(customer.Id);
            ProjectsViewSource.Source     = projects;
            ProjectsGridView.SelectedItem = null;
            PageTitle.Text = string.Format("{0} projects", customer.Name);

            base.OnNavigatedTo(e);
        }
Пример #2
0
        private async void GetProjects()
        {
            try
            {
                List <Project> projectList = await _vm.GetProjects();

                //Set up adapter and stuff here
                projectsAdapter = new ProjectsAdapter(this.Activity, projectList);

                ListView listView = View.FindViewById <ListView>(Resource.Id.lv_projects);

                listView.ItemClick += listView_ItemClick;
                listView.Adapter    = projectsAdapter;
            }
            catch (Exception e)
            {
                //Show exception message here
                Console.WriteLine("Exception occured. Reason:" + e.Message);
            }
        }