Persian calendar WPF calendar with support for Gregorian and solar calendars
$ dotnet add package PersianDateTimeWPFToolsPlease see the test project for further guidance.





You can manually change the Culture of the control using the following code in XAML or C#.
XAML
CustomCultureName="fa-IR"
C#
pcwc1.CustomCulture = CultureInfo.CreateSpecificCulture("en-US");
If you do not select Culture, it will be automatically selected based on the software's Culture.
Step 1: Add the following resources in the App.xaml file
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pdtt="https://github.com/Behnam2064/PersianDateTimeWPFTools"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<pdtt:InitResources />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Step 2: Use in XAML (WPF) files You can use below namespace in xaml (wpf)
xmlns:pdtt="https://github.com/Behnam2064/PersianDateTimeWPFTools"
Sample:
<Window
xmlns:pdtt="https://github.com/Behnam2064/PersianDateTimeWPFTools">
<Grid>
<pdtt:PersianCalendar />
</Grid>
</Window>

New Dependency Properties
| Name | Description | Default |
|---|---|---|
| CustomCulture | Selecting a different culture than the current software culture | Based on the current software culture |
| CustomCultureName | Choosing a culture name that is different from the current software culture (such as fa-IR or en-US) | Based on the current software culture |
| AllowSelectBlackedOutDay | Selectable holidays | False |
| ShowTodayButton | Show a button to move to the current day | False |
| ShowConfirmButton | Show a button to display confirm button | False |
| DisplayDate | Displays the current date | ? |
| DisplayDateStart | Start displaying the date | ? |
| DisplayDateEnd | End of displaying date | ? |
| DisplayMode | Date display type (like Month,Year,Decade) | Month |
| FirstDayOfWeek | First day of the week | Sunday |
| SelectionMode | Type of selection | SingleDate |
| IsTodayHighlighted | Show current day as highlights | True |
| ✨ DayMetadata | Introduce DayMetadata API for unified per-day customization such as Tooltip, DayIndicators, DayIndicatorStyle, etc. | |
| ✨ DayToolTips | Show Tooltip for calendar days | |
| ✨ DayToolTipTemplate | A template for a tooltip | |
| ✨ DayIndicators | Display Indicator for calendar days | |
| ✨ DayIndicatorStyle | A style for the Indicator |

introduce DayMetadata API for unified per-day customization
DayMetadata
↓
DayToolTips / DayIndicators
↓
Default behavior
First you need to familiarize yourself with the properties of the CalendarDayInfo class.
| Name | Description | Default |
|---|---|---|
| ToolTip | Show Tooltip for calendar days | |
| ToolTipTemplate | A template for a tooltip. | |
| HasIndicator | Display Indicator for calendar days | False |
| IndicatorStyle | A style for the Indicator (You can create a unique style for each day.) | |
| IsDisabled | Disable specific day | False |
| ShowToolTipWhenDisabled | Show Tooltip for disabled days | True |
C#
persianCalendar.DayMetadata = new Dictionary<DateTime, CalendarDayInfo>
{
[new DateTime(2025, 12, 29)] = new CalendarDayInfo
{
ToolTip = "Meeting with the marketing team",
},
[new DateTime(2025, 12, 31)] = new CalendarDayInfo
{
ToolTip = "Important meeting with the development team",
HasIndicator = true,
IndicatorStyle = Resources["DayIndicatorRedStyle"] as Style,
},
[new DateTime(2025, 12, 21)] = new CalendarDayInfo
{
ToolTip = "My love's birthday",
HasIndicator = true,
IsDisabled = true,
ShowToolTipWhenDisabled = true,
IndicatorStyle = this.Resources["DayIndicatorGreenStyle"] as Style,
ToolTipTemplate = Resources["FancyDayToolTipTemplate"] as DataTemplate,
}
};
The DateTime object should only contain dates.
If you want to update DayMetadata you need to do something like the following
var preDayMetadata = persianCalendar.DayMetadata;
preDayMetadata.Add(DateTime.Today.AddDays(2), new CalendarDayInfo() { ToolTip = "Don't forget about renting a house.", HasIndicator = true });
persianCalendar.DayMetadata = preDayMetadata;
💫Creating a Style for the Day Indicator
<Style
x:Key="DayIndicatorRedStyle"
TargetType="Ellipse">
<Setter
Property="Width"
Value="10" />
<Setter
Property="Height"
Value="10" />
<Setter
Property="Fill"
Value="Red" />
<Setter
Property="VerticalAlignment"
Value="Top" />
<Setter
Property="HorizontalAlignment"
Value="Right" />
<Setter
Property="Margin"
Value="2,2,2,4" />
</Style>

C#
persianCalendar.DayToolTips = new Dictionary<DateTime, object>
{
{ DateTime.Today,"It is today."},
{ DateTime.Today.AddDays(1),"It is tomorrow."},
};
The DateTime object should only contain dates.
If you want to update Day ToolTips you need to do something like the following
var preTooltips = persianCalendar.DayToolTips;
preTooltips.Add(DateTime.Today.AddDays(2), "Important business meeting");
persianCalendar.DayToolTips = preTooltips;
XAML
<DataTemplate
x:Key="FancyDayToolTipTemplate">
<Border
Background="#222"
Padding="8"
CornerRadius="6">
<StackPanel>
<TextBlock
Text="{Binding}"
Foreground="White"
FontWeight="Bold" />
<TextBlock
Text="More..."
Foreground="LightGray"
FontSize="11" />
</StackPanel>
</Border>
</DataTemplate>
And in your control
DayToolTipTemplate="{StaticResource FancyDayToolTipTemplate}"

C#
persianCalendar.DayIndicators = new Dictionary<DateTime, bool>
{
[new DateTime(2025, 12, 23)] = true,
[new DateTime(2025, 12, 25)] = true
};
The DateTime object should only contain dates.
If you want to update Day Indicators you need to do something like the following
var preDayIndicators = persianCalendar.DayIndicators;
preDayIndicators.Add(DateTime.Today.AddDays(2), true);
persianCalendar.DayIndicators = preDayIndicators;
<Style
x:Key="RedDotIndicatorStyle"
TargetType="Ellipse">
<Setter
Property="HorizontalAlignment"
Value="Right" />
<Setter
Property="VerticalAlignment"
Value="Top" />
<Setter
Property="Width"
Value="10" />
<Setter
Property="Height"
Value="10" />
<Setter
Property="Fill"
Value="Red" />
</Style>
And in your control
DayIndicatorStyle="{StaticResource RedDotIndicatorStyle}"
In the App.xaml file, you can select one of the following themes by selecting the SelectedTheme property in the InitResources class.
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pdtt="https://github.com/Behnam2064/PersianDateTimeWPFTools"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<pdtt:InitResources
SelectedTheme="LightModern1"
/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
You can do the following in the constructor of the App.xaml.cs class:
public partial class App : Application
{
public App()
{
var init = new InitResources();
init.SelectedTheme = PersianDateTimeWPFTools.Themes.BaseThemeName.DarkModern1;
}
}
or
public partial class App : Application
{
public App()
{
InitResources.SetTheme(new ThemeDarkModern1());
}
}
public partial class App : Application
{
public App()
{
new InitResources()
.ChangeLanguage("fa"); // en
}
}
To read the language resources, please visit the link below. Github Link
public partial class App : Application
{
public App()
{
new InitResources()
.ChangeLanguage(null, "pack://application:,,,/TestPersianCalendar;component/Lang.es.xaml"); // Your resource address
}
}
The next feature could be new themes 💫