public void show() { LayoutInflater inflater = (LayoutInflater)Application.Context.GetSystemService(Context.LayoutInflaterService); View npView = inflater.Inflate(Resource.Layout.dialog_numberpicker, null); numberPicker = npView.FindViewById <NumberPicker>(Resource.Id.numberPicker1); numberPicker.MaxValue = new DateTime().Year; numberPicker.MinValue = 1900; numberPicker.SetGravity(GravityFlags.Center); numberPicker.WrapSelectorWheel = true; numberPicker.SetScrollContainer(true); numberPickerAlertDialog = new AlertDialog.Builder(this).SetTitle("Occupation Year").SetView(npView) .SetPositiveButton(Resource.String.done, delegate { occupationYear.Text = numberPicker.Value.ToString(); numberPickerAlertDialog.Dismiss(); }).SetNegativeButton(Resource.String.cancel, delegate { numberPickerAlertDialog.Dismiss(); }).Create(); numberPickerAlertDialog.Show(); }