Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TimePicker in Wpf Toolkit

I want a timepicker control in WPF. I found an implementation here.(http://wpftoolkit.codeplex.com/wikipage?title=TimePicker&referringTitle=Home). I have installed it. But couldn't understand how to use it. I don't know what I need to write in the XAML file.

like image 344
muhammedkasva Avatar asked Mar 16 '26 17:03

muhammedkasva


1 Answers

Instructions are provided in the link itself here. Follow these steps and you are good to go -

  1. Install the binaries first from here.

  2. Extract the dll Xceed.Wpf.Toolkit and add reference to this dll in your project.

  3. In XAML add the namespace - xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"

4.Then add the instance of TimePickerControl in your xaml -

<Grid>
   <xctk:TimePicker Height="30" Width="100" Value="{Binding CurrentDateTime}"/>
</Grid>

In your ViewModel -

private DateTime currentDateTime = DateTime.Now;
public DateTime CurrentDateTime
{
   get
   {
      return currentDateTime ;
   }
   set
   {
      currentDateTime = value;
   }
}
like image 176
Rohit Vats Avatar answered Mar 19 '26 07:03

Rohit Vats



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!