Skip to content

Instantly share code, notes, and snippets.

@VincentDondain
Created November 25, 2016 12:13
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 VincentDondain/b2e4803d1402451300fdcd2fb8768478 to your computer and use it in GitHub Desktop.
Save VincentDondain/b2e4803d1402451300fdcd2fb8768478 to your computer and use it in GitHub Desktop.
public partial class ViewController : UIViewController, IUIPickerViewDataSource
{
protected ViewController (IntPtr handle) : base (handle)
{
// Note: this .ctor should not contain any initialization logic.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
var view = new UIPickerView ();
view.Model = new UIPickerViewModel ();
view.DataSource = this;
Add (view);
}
public override void DidReceiveMemoryWarning ()
{
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public nint GetComponentCount (UIPickerView pickerView)
{
return 1;
}
public nint GetRowsInComponent (UIPickerView pickerView, nint component)
{
return 5;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment