PersianDateTimeWPFTools 1.0.6.3

dotnet add package PersianDateTimeWPFTools --version 1.0.6.3
                    
NuGet\Install-Package PersianDateTimeWPFTools -Version 1.0.6.3
                    
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="PersianDateTimeWPFTools" Version="1.0.6.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PersianDateTimeWPFTools" Version="1.0.6.3" />
                    
Directory.Packages.props
<PackageReference Include="PersianDateTimeWPFTools" />
                    
Project file
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 PersianDateTimeWPFTools --version 1.0.6.3
                    
#r "nuget: PersianDateTimeWPFTools, 1.0.6.3"
                    
#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.
#addin nuget:?package=PersianDateTimeWPFTools&version=1.0.6.3
                    
Install PersianDateTimeWPFTools as a Cake Addin
#tool nuget:?package=PersianDateTimeWPFTools&version=1.0.6.3
                    
Install PersianDateTimeWPFTools as a Cake Tool

Persian calendar

WPF calendar with support for Gregorian and solar calendars

  • A free Persian calendar with the ability to support the Gregorian calendar that can be used in WPF
  • You can write any style you like for the controls.
  • Language change support and other resources

Please see the test project for further guidance.

Controls

  • Clock

IMAGE_DESCRIPTION

  • PersianCalendar

IMAGE_DESCRIPTION

  • PersianDatePicker

IMAGE_DESCRIPTION

  • PersianDateTimePicker

IMAGE_DESCRIPTION

  • PersianCalendarWithClock

IMAGE_DESCRIPTION

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.

How to use?

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>

Ability to write custom styles for all controls

IMAGE_DESCRIPTION

Dependency Properties

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

How to change the theme

In the App.xaml file, you can select one of the following themes by selecting the SelectedTheme property in the InitResources class.

  • Default
  • DarkModern1
  • LightModern1
<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>

How to change theme in C#

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());
        }
    }

How to change the control language?

public partial class App : Application
    {        
        public App()
        {
            new InitResources()
            .ChangeLanguage("fa"); // en
        }
    }

How to change the language of controls with our own resources

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 update will include adding a tooltip to the days button.

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net7.0-windows7.0 is compatible.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.
  • net7.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • 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.

Version Downloads Last updated
1.0.6.3 158 5/11/2025
1.0.5.1 97 4/12/2025
1.0.5 164 4/10/2025
1.0.4.2 87 4/5/2025
1.0.3 119 4/4/2025
1.0.0.8 160 4/3/2025
1.0.0.7 136 3/30/2025
1.0.0.6 137 3/30/2025
1.0.0.5 474 3/25/2025
1.0.0.4 150 3/19/2025

-Fixed some issues with AddRange DateTime to SelectedDates before loading
-Fixed some issues with Display PersianDateTimePicker (Styling)