public static TimePickerFragment NewInstance(Action <DateTime> onTimeSelected)
        {
            TimePickerFragment frag = new TimePickerFragment();

            frag.timeSelectedHandler = onTimeSelected;
            return(frag);
        }
Пример #2
0
        // Handler for the button click
        void TimeSelectOnClick(object sender, EventArgs eventArgs)
        {
            // Instantiate a TimePickerFragment (defined below)
            TimePickerFragment frag = TimePickerFragment.NewInstance(
                delegate(DateTime time)
            {
                timeDisplay.Text = time.ToShortTimeString();
            });

            // Launch the TimePicker dialog fragment (defined below):
            frag.Show(FragmentManager, TimePickerFragment.TAG);
        }