TimePicker-Wpf
1.1.3
dotnet add package TimePicker-Wpf --version 1.1.3
NuGet\Install-Package TimePicker-Wpf -Version 1.1.3
<PackageReference Include="TimePicker-Wpf" Version="1.1.3" />
<PackageVersion Include="TimePicker-Wpf" Version="1.1.3" />
<PackageReference Include="TimePicker-Wpf" />
paket add TimePicker-Wpf --version 1.1.3
#r "nuget: TimePicker-Wpf, 1.1.3"
#:package TimePicker-Wpf@1.1.3
#addin nuget:?package=TimePicker-Wpf&version=1.1.3
#tool nuget:?package=TimePicker-Wpf&version=1.1.3
TimePicker-Wpf
A customizable WPF Time Picker control for .NET 8, supporting 12-hour (AM/PM) and 24-hour formats with hour, minute, and second selection. The control is designed for easy integration and flexible styling in your WPF applications.
Features
- 12-hour time selection (AM/PM)
- 24-hour time selection
- Select hours, minutes, and seconds
- Data binding support for selected value and DateTime
- Customizable appearance (font, colors, borders, etc.)
- Popup-based UI for compact display
- Format selection via
TimeFormatType
enum
Prerequisites
- .NET 8 SDK
- Visual Studio 2022 or later
Installation
- Add the
TimePicker-Wpf
nuget package to your WPF project.
Usage
Add the namespace to your XAML: xmlns:timepicker="clr-namespace:TimePicker_Wpf;assembly=TimePicker-Wpf"
Add the
TimeView
control to your window or user control:
<timepicker:TimeView SelectedValue="{Binding SelectedTimeString, Mode=TwoWay}" SelectedDateTime="{Binding SelectedDateTime, Mode=TwoWay}" FontFamily="Segoe UI" FontSize="14" ForegroundColor="Black" BackgroundColor="White" BorderBrushColor="Gray" BorderThickness="2" CornerRadius="5" TimeFormat="F_12Hour" />
- Bind to the
SelectedValue
(string, e.g. "03:15:45 PM") orSelectedDateTime
(DateTime) properties in your ViewModel.
Time Format Selection
The time picker supports both 12-hour (AM/PM) and 24-hour formats.
You can specify the desired format using the TimeFormat
property, which accepts values from the TimeFormatType
enum:
API Overview
Property | Type | Description |
---|---|---|
Padding | Thickness | Set padding of the control. |
TimeIcon | ImageSource | Set time picker icon as per choice. |
IconHeightWidth | double | Set height and width for time picker icon. |
SelectedDateTime | DateTime | The currently selected time. |
SelectedValue | string | The selected time as a formatted string. |
TimeFormat | TimeFormatType | Enum for time format (e.g., F_12Hour, F_24Hour). |
FontFamily | FontFamily | Font for the control. |
FontSize | double | Font size. |
ForegroundColor | Brush | Text color. |
BackgroundColor | Brush | Background color. |
BorderBrushColor | Brush | Border color. |
BorderThickness | Thickness | Border thickness. |
CornerRadius | CornerRadius | Border corner radius. |
Events
- TimeChanged : Raised when the time selection changed.
Methods
- ResetTime() : Resets the picker to the current system time.
License
This project is licensed under the MIT License.
Acknowledgments
- Built with WPF and .NET 8.
Attribution
Flaticon
Mobile app icons created by FACH - Flaticon
TimePicker-Wpf � The easy way to add a modern Time Picker to your WPF apps.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows10.0.26100 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows10.0.26100
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Hide meradian column when 24 hour format is set.