Last active
October 14, 2017 09:08
-
-
Save MarcBruins/8d3b81d06daa71a86da027267a33e6ef to your computer and use it in GitHub Desktop.
MonkeyTableviewcell
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 Foundation; | |
using MvvmCross.Binding.BindingContext; | |
using MvvmCross.Binding.iOS.Views; | |
using UIKit; | |
namespace MonkeyList.Core.iOS | |
{ | |
public partial class MonkeyCell : MvxTableViewCell | |
{ | |
public static readonly NSString Key = new NSString("MonkeyCell"); | |
public static readonly UINib Nib; | |
static MonkeyCell() | |
{ | |
Nib = UINib.FromName("MonkeyCell", NSBundle.MainBundle); | |
} | |
protected MonkeyCell(IntPtr handle) : base(handle) | |
{ | |
var imageViewLoader = new MvxImageViewLoader(() => monkeyImage); | |
// Note: this .ctor should not contain any initialization logic. | |
this.DelayBind(() => | |
{ | |
var set = this.CreateBindingSet<MonkeyCell, Monkey>(); | |
set.Bind(imageViewLoader).To(m => m.Image); | |
set.Bind(nameLabel).To(m => m.Name); | |
set.Bind(originLabel).To(m => m.Location); | |
set.Bind(descriptionLabel).To(m => m.Details); | |
set.Apply(); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment