Beispiel #1
0
        private void SetDate()
        {
            DateTime           date;
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime setDate)
            {
                date = setDate;

                TimePickerFragment frag2 = TimePickerFragment.NewInstance(
                    delegate(TimeSpan time)
                {
                    //StartDate = date.Add(time);
                    if (IsStartDate)
                    {
                        StartDate = date.Add(time);
                        _view.FindViewById <TextView>(Resource.Id.StartDate).Text = date.ToLongDateString();
                    }
                    else
                    {
                        EndDate = date.Add(time);
                        _view.FindViewById <TextView>(Resource.Id.EndDate).Text = date.ToLongDateString();
                    }
                });

                frag2.Show(Activity.FragmentManager, TimePickerFragment.TAG);
            });

            frag.Show(Activity.FragmentManager, DatePickerFragment.TAG);
        }
Beispiel #2
0
        public static TimePickerFragment NewInstance(Action <TimeSpan> onTimeSelected)
        {
            TimePickerFragment frag = new TimePickerFragment();

            frag.timeSelectedHandler = onTimeSelected;
            return(frag);
        }