protected override void ViewModelReady() { base.ViewModelReady(); var source = new StandardTableViewSource(TableView, UITableViewCellStyle.Default, "ContactInfoItems", "TitleText Title"); TableView.Source = source; var set = this.CreateBindingSet<ContactInfoView, ContactInfoViewModel>(); set.Bind(source).To(vm => vm.InfoBoxes); set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.ShowDetailsCommand); set.Apply(); TableView.ReloadData(); }
protected override void ViewModelReady() { base.ViewModelReady(); LoadingOverlay.LoadingText = "Henter åpningstider..."; var source = new StandardTableViewSource(TableView, UITableViewCellStyle.Default, "OpeningHoursLocations", "TitleText Title"); TableView.Source = source; var set = this.CreateBindingSet<OpeningHoursView, OpeningHoursViewModel>(); set.Bind(source).To(vm => vm.Locations); set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.ShowDetailsCommand); set.Apply(); TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Logg ut", UIBarButtonItemStyle.Plain, DoLogout), false); LoadingOverlay.LoadingText = "Henter din side..."; var source = new StandardTableViewSource(TableView, UITableViewCellStyle.Default, "MyPageSections", "TitleText Title"); var sections = new List<MyPageSection>(); sections.Add(new MyPageSection{ Title = "Favoritter", ViewModel = ViewModel.MyPageFavoritesViewModel }); sections.Add(new MyPageSection{ Title = "Lån", ViewModel = ViewModel.MyPageLoansViewModel }); sections.Add(new MyPageSection{ Title = "Reservasjoner", ViewModel = ViewModel.MyPageReservationsViewModel }); sections.Add(new MyPageSection{ Title = "Gebyrer", ViewModel = ViewModel.MyPageFinesViewModel }); var messagesSection = new MyPageSection{ Title = "Meldinger (..)", ViewModel = ViewModel.MyPageMessagesViewModel }; sections.Add(messagesSection); sections.Add(new MyPageSection{ Title = "Min profil", ViewModel = ViewModel.MyPagePersonaliaViewModel }); ViewModel.MyPageMessagesViewModel.WaitForReady(() => { InvokeOnMainThread(() => { messagesSection.Title = String.Format("Meldinger ({0})", ViewModel.MyPageMessagesViewModel.Notifications.Count); TableView.ReloadRows(TableView.IndexPathsForVisibleRows, UITableViewRowAnimation.Fade); }); }); source.ItemsSource = sections; source.SelectedItemChanged += (s, e) => { var item = (MyPageSection)source.SelectedItem; var ctl = this.CreateViewControllerFor(sections.First(se => se.Title == item.Title).ViewModel) as UIViewController; this.NavigationController.PushViewController(ctl, true); }; TableView.Source = source; }
protected override void ViewModelReady() { base.ViewModelReady(); LoadingOverlay.LoadingText = "Henter åpningstider..."; var source = new StandardTableViewSource(TableView, "TitleText Key + If(Value.Length>0, ': ','') + Value"); TableView.Source = source; TableView.AllowsSelection = false; var set = this.CreateBindingSet<OpeningHoursLocationView, OpeningHoursLocationViewModel>(); set.Bind(source).To(vm => vm.Hours); set.Apply(); TableView.ReloadData(); }