コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Date Picker";

            // setup our custom action sheet date picker
            actionSheetDatePicker = new UIViewDatePicker(View)
            {
                Title = "Choose Date:"
            };
            UIDatePicker dp = actionSheetDatePicker.DatePicker;

            dp.ValueChanged += Handle_actionSheetDatePickerDatePickerValueChanged;
            dp.Mode          = UIDatePickerMode.DateAndTime;
            dp.MinimumDate   = (NSDate)DateTime.Today.AddDays(-7);
            dp.MaximumDate   = (NSDate)DateTime.Today.AddDays(7);

            btnChooseDate.TouchUpInside += (s, e) => { actionSheetDatePicker.Show(); };

            // setup our countdown timer
            actionSheetTimerPicker = new UIViewDatePicker(View)
            {
                Title = "Choose Time:"
            };
            actionSheetTimerPicker.DatePicker.Mode = UIDatePickerMode.CountDownTimer;
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.Title = "Date Picker";

            // setup our custom action sheet date picker
            actionSheetDatePicker       = new UIViewDatePicker(this.View);
            actionSheetDatePicker.Title = "Choose Date:";
            actionSheetDatePicker.DatePicker.ValueChanged += Handle_actionSheetDatePickerDatePickerValueChanged;
            actionSheetDatePicker.DatePicker.Mode          = UIDatePickerMode.DateAndTime;
            this.btnChooseDate.TouchUpInside += (s, e) => {
                actionSheetDatePicker.Show();
            };

            // setup our countdown timer
            actionSheetTimerPicker                 = new UIViewDatePicker(this.View);
            actionSheetTimerPicker.Title           = "Choose Time:";
            actionSheetTimerPicker.DatePicker.Mode = UIDatePickerMode.CountDownTimer;
        }