用于UWP TimePicker步骤的Telerik UI属性

时间:2019-02-07 14:02:23

标签: xaml uwp telerik

我试图在RadTimePicker上将分钟增量设置为1到5。这里的telerik文档:

https://docs.telerik.com/devtools/universal-windows-platform/controls/raddatepicker-and-radtimepicker/properties-and-configuration/raddatetimepickers-properties-pickerproperties

Step (DateTimeOffset): Gets or sets the step that will be applied to the picker date/time lists. Each list will take the correspomding component fron the DateTimeOffset structure.

没有示例代码,我不知道这意味着什么或如何执行,但是我已经尝试过了:

   InitializeComponent();
   var t = new DateTimeOffset();
   t.AddMinutes(5);
   timePickerz.Step = t;

在后面的代码中,但效果不好。

1 个答案:

答案 0 :(得分:1)

我一边测试了RadTimePicker控件,没有问题。例如,如果我将Step设置为6分钟,则分钟选择器将步进6分钟。

RadTimePicker myTimePicker = new RadTimePicker();
myTimePicker.DisplayMode = DateTimePickerDisplayMode.Standard;
myTimePicker.Step = new DateTimeOffset().AddMinutes(6);

enter image description here