Clock control displays a virtual clock, allowing the user to select the time on this clock.
1 2 3 4 5 6 7 8
[TemplatePart(Name = ElementButtonAm, Type = typeof(RadioButton))] [TemplatePart(Name = ElementButtonPm, Type = typeof(RadioButton))] [TemplatePart(Name = ElementCanvas, Type = typeof(Canvas))] [TemplatePart(Name = ElementBorderTitle, Type = typeof(Border))] [TemplatePart(Name = ElementBorderClock, Type = typeof(Border))] [TemplatePart(Name = ElementPanelNum, Type = typeof(CirclePanel))] [TemplatePart(Name = ElementTimeStr, Type = typeof(TextBlock))] publicclassClock : ClockBase
Create Clock
1
<hc:Clock />
1
var clock = new Clock();
The generated Clock is shown below:
Choose time
You can select the time by clicking the clock on the left, or by clicking the hour, minute, and second list on the right. You can also set the date like this in a XAML clock or code.