Calendar-Wpf
1.1.5
dotnet add package Calendar-Wpf --version 1.1.5
NuGet\Install-Package Calendar-Wpf -Version 1.1.5
<PackageReference Include="Calendar-Wpf" Version="1.1.5" />
<PackageVersion Include="Calendar-Wpf" Version="1.1.5" />
<PackageReference Include="Calendar-Wpf" />
paket add Calendar-Wpf --version 1.1.5
#r "nuget: Calendar-Wpf, 1.1.5"
#:package Calendar-Wpf@1.1.5
#addin nuget:?package=Calendar-Wpf&version=1.1.5
#tool nuget:?package=Calendar-Wpf&version=1.1.5
Calendar-Wpf
A modern, customizable WPF calendar control for .NET 8 applications. Easily integrate a feature-rich calendar UI into your desktop projects. It provides a modern, user-friendly interface for date selection, supporting month and year navigation, and is designed for easy integration into your WPF projects.
Features
- Date Selection: Select a date from a visual calendar or by direct text input.
- Multiple Date Formats: Choose from several common date formats or define your own.
- Navigation: Easily switch between month, year, and decade views.
- Theming: Customize colors, borders, font, and corner radius.
- MVVM Support: All main properties are dependency properties for easy data binding.
- Validation: Prevents selection of future dates if desired.
- Editable Mode: Toggle between editable text input and read-only display.
- Events: Notifies when the selected date changes.
Installation
Install via NuGet Package Manager:
Or via .NET CLI:
dotnet add package Calendar-Wpf
Usage
- Add Namespace
In your XAML file:
xmlns:calendar="clr-namespace:CalendarWpf;assembly=Calendar-Wpf"
- Add the CalendarView Control
<calendar:CustomCalendar x:Name="myCalendar" AllowFutureDate="False" // Set to true to allow future dates DateFormat="MM_dd_yyyy" // Choose from DateFormatType enum IsEditable="False" /> // Set IsEditable to true to allow text editing
- To reset the control use the Initialize method: For e.g. myCalendar.Initialize(); in the code behind.
API Overview
Property | Type | Description |
---|---|---|
Padding | Thickness | Set padding of the control. |
CalendarIcon | ImageSource | Set calendar icon as per choice. |
IconHeightWidth | double | Set height and width for calendar icon. |
SelectedDateTime | DateTime | The currently selected date. |
SelectedDateText | string | The selected date as a formatted string. |
DateFormat | DateFormatType | Enum for date format (e.g., MM_dd_yyyy, yyyy_MM_dd). |
AllowFutureDate | bool | If false, prevents selecting dates in the future. |
IsEditable | bool | Allows direct text editing of the date. |
FontFamily | FontFamily | Font for the control. |
FontSize | double | Font size. |
ForegroundColor | Brush | Text color. |
PlaceholderColor | Brush | Mask placeholder color. |
BackgroundColor | Brush | Background color. |
BorderBrushColor | Brush | Border color. |
BorderThickness | Thickness | Border thickness. |
CornerRadius | CornerRadius | Border corner radius. |
DateFormatType Enum
- dd_MM_yyyy
- dd_MM_yy
- M_d_yyyy
- M_d_yy
- MM_dd_yy
- MM_dd_yyyy
- yy_MM_dd
- yyyy_MM_dd
Requirements
- .NET 8 or later
- Windows Presentation Foundation (WPF)
Attribution
Flaticon
Calendar day icons created by Rakib Hassan Rahim - Flaticon
License
This project is licensed under the MIT License.
Contributing
Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request.
Calendar-Wpf � The easy way to add a modern calendar 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.
Major changes in User interface.
Show previous month and next month dates in current month.
Allowed date show in bold font weight.
Bug fixes.