Created
October 14, 2017 09:13
-
-
Save MarcBruins/c310a9e5e13a7539d824162045333434 to your computer and use it in GitHub Desktop.
MonkeysView.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonkeyList.Core.ViewModels; | |
using MvvmCross.Binding.BindingContext; | |
using MvvmCross.Binding.iOS.Views; | |
using MvvmCross.iOS.Views; | |
using UIKit; | |
namespace MonkeyList.Core.iOS | |
{ | |
public partial class MonkeysView : MvxViewController<MonkeysViewModel> | |
{ | |
public MonkeysView() : base("MonkeysView", null) | |
{ | |
} | |
public override void ViewDidLoad() | |
{ | |
base.ViewDidLoad(); | |
// Perform any additional setup after loading the view, typically from a nib. | |
NavigationItem.Title = "Monkeys"; | |
var source = new MvxSimpleTableViewSource(MonkeyTableView, "MonkeyCell", MonkeyCell.Key); | |
MonkeyTableView.RowHeight = 130; | |
var set = this.CreateBindingSet<MonkeysView, MonkeysViewModel>(); | |
set.Bind(source).To(vm => vm.Monkeys); | |
set.Apply(); | |
MonkeyTableView.Source = source; | |
MonkeyTableView.ReloadData(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment