Ejemplo n.º 1
0
        public ActionResult List()
        {
            Data.Repositories.CinemaRepository cinemaRepo = new Data.Repositories.CinemaRepository();

            ViewModels.ListViewModel MovieModels = new ViewModels.ListViewModel();

            IList <Data.Entities.Movie> MovieEntities = new List <Data.Entities.Movie>();

            MovieEntities = cinemaRepo.GetListOfMovies();

            foreach (var item in MovieEntities)
            {
                ViewModels.Movie Movie = new ViewModels.Movie()
                {
                    Id                 = item.Id,
                    Title              = item.Title,
                    Synopsis           = item.Synopsis,
                    ExpectedPopularity = item.ExpectedPopularity,
                    ActualPopularity   = item.ActualPopularity,
                    OptimalSeason      = item.OptimalSeason,
                    WorstSeason        = item.WorstSeason,
                    CostLicense        = item.CostLicense,
                    LicenseLength      = item.LicenseLength,
                    DateCreated        = item.DateCreated,
                    DateModified       = item.DateModified
                };
                MovieModels.Movies.Add(Movie);
            }

            return(View(MovieModels));
        }
Ejemplo n.º 2
0
 protected override void OnAppearing()
 {
     ViewModels.ListViewModel viewModel = BindingContext as ViewModels.ListViewModel;
     if (viewModel.RefreshCommand.CanExecute(null))
     {
         viewModel.RefreshCommand.Execute(null);
     }
     base.OnAppearing();
 }
Ejemplo n.º 3
0
 protected void listView_ItemTapped(object sender, ItemTappedEventArgs e)
 {
     ViewModels.ListViewModel viewModel = BindingContext as ViewModels.ListViewModel;
     Models.Item item = e.Item as Models.Item;
     if (viewModel.ItemClickedCommand.CanExecute(item))
     {
         viewModel.ItemClickedCommand.Execute(item);
     }
     listView.SelectedItem = null;
 }
Ejemplo n.º 4
0
        public ListPage()
        {
            InitializeComponent();

            BindingContext = new ViewModels.ListViewModel();

            if (Device.RuntimePlatform == "iOS")
            {
                Padding = new Thickness(0, 20, 0, 0);
            }
        }
Ejemplo n.º 5
0
 void Refresh(ViewModels.ListViewModel <Data.ForumDataSource> viewmodel)
 {
     refreshRequsted       = true;
     viewmodel.DataLoaded += OnViewmodelDataLoaded;
     viewmodel.Refresh();
 }