Calendar-Wpf
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Calendar-Wpf --version 1.1.1
NuGet\Install-Package Calendar-Wpf -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Calendar-Wpf" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Calendar-Wpf" Version="1.1.1" />
<PackageReference Include="Calendar-Wpf" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Calendar-Wpf --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Calendar-Wpf, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Calendar-Wpf@1.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Calendar-Wpf&version=1.1.1
#tool nuget:?package=Calendar-Wpf&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Calendar-Wpf
Calendar-Wpf is a reusable, customizable calendar/date picker control for WPF applications targeting .NET 8. 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
- Modern WPF Calendar Control
Intuitive UI for selecting dates, with support for month and year navigation. - Bindable Properties
SelectedDate
: The currently selected date (bindable).DateFormatText
: The formatted date string (bindable).AllowFutureDate
: Option to allow or restrict selection of future dates.
- Customizable Appearance
Built with XAML for easy styling and theming. - Event Support
SelectedDateChanged
: Event raised when the selected date changes.
- Keyboard and Mouse Support
Interact with the calendar using mouse or keyboard. - No External Dependencies
Pure WPF/XAML and C#.
Getting Started
Prerequisites
- .NET 8 SDK
- Visual Studio 2022 or later
Installation
- Add the
Calendar-Wpf
project to your solution. - Reference the project in your WPF application.
Usage
- Add the namespace to your XAML:
xaml xmlns:local="clr-namespace:Calendar_Wpf"
2. Add theCalendarView
control to your window or user control:xaml <local:CalendarView x:Name="myCalendarView" SelectedDate="{Binding MyDateProperty, Mode=TwoWay}" AllowFutureDate="False" />
3. (Optional) Handle theSelectedDateChanged
event in code-behind:```csharp myCalendarView.SelectedDateChanged += (s, e) ⇒ { // Handle date change };
4. To reset the control use the Initialize method: For e.g. myCalendarView.Initialize(); in the code behind.
---
## Properties
| Property | Type | Description |
|------------------|-----------|--------------------------------------------------|
| SelectedDate | DateTime | The currently selected date. Bindable. |
| DateFormatText | string | The formatted date string. Bindable. |
| AllowFutureDate | bool | Allow selection of future dates (default: false) |
---
## Events
| Event | Description |
|----------------------|---------------------------------------------|
| SelectedDateChanged | Raised when the selected date is changed. |
---
## Customization
- **Appearance**: Modify `CalendarView.xaml` for custom styles and templates.
- **Date Format**: Set or bind `DateFormatText` to control the displayed date format.
- **Icons/Fonts**: Replace icons or fonts in the `Resources` folder as needed.
---
## Example
## Attribution
<a href="https://www.flaticon.com/free-icons/calendar-day" title="calendar day icons">Calendar day icons created by Rakib Hassan Rahim - Flaticon</a>
<a href="https://www.flaticon.com">Flaticon</a>
## License
This project is licensed under the MIT License.
## Acknowledgments
- Built with WPF and .NET 8.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
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.