muhammedkasva
muhammedkasva

Reputation: 672

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.

Upvotes: 3

Views: 18071

Answers (1)

Rohit Vats
Rohit Vats

Reputation: 81233

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;
   }
}

Upvotes: 11

Related Questions