Search code examples
c#win-universal-apptimepickerwindows-10-universal

How to show seconds in Windows 10 UWP TimePicker control?


I am currently working in Windows 10 and want to create a countdown timer similar to Count Down Timer. In this sample, they have used Coding4Fun Toolkit and when I added this through Nuget Package Manager it didn't have TimeSpanPicker control so I tried with Time Picker and it works perfectly fine. The only issue is it is showing only hours and minutes and not seconds. Is there any way we can add seconds section directly or by editing TimePicker template or any third party available?

Please suggest whether it is possible or not?


Solution

  • As discussed use TextBlock instead of TimePicker,since you don't want user to edit the timer value. Use DispatcherTimer class to implement countdown. you may have to use Dispatcher.RunAsync method to update the UI thread.