public static DatePickerFragment NewInstance(Action <DateTime> onDateSelected) { DatePickerFragment frag = new DatePickerFragment(); frag._dateSelectedHandler = onDateSelected; return(frag); }
void DateSelect_OnClick(object sender, EventArgs eventArgs) { DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time) { depDate.Text = "Departure Date: " + time.DayOfWeek.ToString() + " " + time.ToLongDateString(); initialDepDate = time; }); frag.Show(FragmentManager, DatePickerFragment.TAG); }
private void addDateClicked(object sender, EventArgs e) { DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time) { additionalDates.Text += time.DayOfWeek.ToString() + " " + time.ToLongDateString() + "\n"; additionalDatesList.Add(time); }); frag.Show(FragmentManager, DatePickerFragment.TAG); }