public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = ColorHelper.Background0.ToPlatformColor(); // Build the header var header = new UIView(); var title = new UILabel(); // Add content to header header.Add(title); // Constraints // Set the header TableView.TableHeaderView = header; // Create table source var source = new MediaListViewSource(TableView); // Init bindings var set = this.CreateBindingSet <PlaylistDetailView, PlaylistDetailViewModel>(); set.Bind(source).For(x => x.ItemsSource).To(vm => vm.Tracks); set.Bind(source).For(x => x.SelectionChangedCommand).To(vm => vm.PlayItemCommand); set.Bind(title).For(x => x.Text).To(vm => vm.Playlist.Title); set.Apply(); // Load Content TableView.PrefetchDataSource = this; TableView.Source = source; TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationController.NavigationBar.PrefersLargeTitles = true; View.BackgroundColor = ColorHelper.Background0.ToPlatformColor(); // Create table source var source = new MediaListViewSource(TableView); // Init bindings var set = this.CreateBindingSet <GenericListView, GenericListViewModel>(); set.Bind(this).For(x => x.Title).To(vm => vm.Title); set.Bind(source).For(x => x.ItemsSource).To(vm => vm.Model); set.Bind(source).For(x => x.SelectionChangedCommand).To(vm => vm.InvokeCommand); set.Apply(); // Load Content TableView.PrefetchDataSource = this; TableView.Source = source; TableView.ReloadData(); }