Reputation: 672
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
Reputation: 81233
Instructions are provided in the link itself here. Follow these steps and you are good to go -
Install the binaries first from here.
Extract the dll Xceed.Wpf.Toolkit
and add reference to this dll in your project.
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