public HuntView() { InitializeComponent(); BindingContext = new HuntViewModel(null) { Location = "Høylandet", Title = "Tittel for siden", DateFrom = DateTime.Now.AddDays(-10), DateTo = DateTime.Now.AddDays(-4) }; }
public ActionResult Hunt() { var shows = DatabaseSession.Query <Show>().Where(x => x.Toaster != string.Empty).ToList(); var viewModel = new HuntViewModel(); viewModel.Shows.AddRange(shows.Select(x => new HuntViewModel.Show { ShowId = x.ShowId, ShowName = x.Title, ShowQuarter = x.Quarter, ShowYear = x.Year, Toaster = x.Toaster, })); return(View(viewModel)); }
public HuntView(HuntViewModel viewModel) { BindingContext = viewModel; InitializeComponent(); }