Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MarcBruins
Last active October 14, 2017 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcBruins/8d3b81d06daa71a86da027267a33e6ef to your computer and use it in GitHub Desktop.
Save MarcBruins/8d3b81d06daa71a86da027267a33e6ef to your computer and use it in GitHub Desktop.
MonkeyTableviewcell
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