public static DatePickerFragment NewInstance(Action <DateTime> onDateSelected, DateTime?startDate)
        {
            DatePickerFragment frag = new DatePickerFragment();

            frag._dateSelectedHandler = onDateSelected;

            _startDate = startDate.HasValue ? startDate.Value : DateTime.Now.AddYears(-30);

            return(frag);
        }
Beispiel #2
0
        EventHandler DateInputTap()
        => delegate
        {
            var frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                ViewModel.SessionDate = time;
            },
                                                      ViewModel.SessionDate);
            frag.Show(Activity.FragmentManager, DatePickerFragment.TAG);

            var inputMethodManager = (InputMethodManager)Activity.GetSystemService(Android.Content.Context.InputMethodService);
            inputMethodManager.HideSoftInputFromWindow(Activity.CurrentFocus.WindowToken, 0);
        };
Beispiel #3
0
        EventHandler <View.FocusChangeEventArgs> DateInputFocusChange()
        => (sender, args) =>
        {
            if (args.HasFocus)
            {
                var frag = DatePickerFragment.NewInstance(delegate(DateTime time)
                {
                    ViewModel.SessionDate = time;
                },
                                                          ViewModel.SessionDate);
                frag.Show(Activity.FragmentManager, DatePickerFragment.TAG);

                var inputMethodManager = (InputMethodManager)Activity.GetSystemService(Android.Content.Context.InputMethodService);
                inputMethodManager.HideSoftInputFromWindow(Activity.CurrentFocus.WindowToken, 0);
            }
        };