Codecell.Component.Blazor
0.2.5
dotnet add package Codecell.Component.Blazor --version 0.2.5
NuGet\Install-Package Codecell.Component.Blazor -Version 0.2.5
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="Codecell.Component.Blazor" Version="0.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Codecell.Component.Blazor --version 0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Codecell.Component.Blazor, 0.2.5"
#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.
// Install Codecell.Component.Blazor as a Cake Addin #addin nuget:?package=Codecell.Component.Blazor&version=0.2.5 // Install Codecell.Component.Blazor as a Cake Tool #tool nuget:?package=Codecell.Component.Blazor&version=0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CodecellComponent.Blazor
Custom Components for Blazor
PersianDatePicker
Features
- Two-Way Binding
- Dark Mode
- Month Navigation
- Year Navigation
- Date Change Event Callback
- Validation
- Mask Input
Installation
You can download the latest version of Codecell.Component.Blazor
from Github repository.
To install via nuget
:
Install-Package Codecell.Component.Blazor -Version 0.2.5
Install from Nuget directly.
How to use
Register Codecell Persian DatePicker Control to project container in Program.cs
file:
using Codecell.Component.Blazor;
builder.Services.AddCodecellBlazor();
Add using to _imports.razor
@using Codecell.Component.Blazor.Components.PersianDatePickerComponent
Add style references
@page "/"
<link href="_content/Codecell.Component.Blazor/codecell.css" rel="stylesheet" />
Usage Sample
@page "/"
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
<div class="row" style="direction:rtl">
<div class="col-md-4 mt-3">
<PersianDatePicker @bind-Date="myDate"
PlaceHolder="تاریخ تولد"
Label="تولد شما:"
ValueChanged="DateChanged"
DarkMode="false"/>
</div>
</div>
<p class="mt-2">@myDate</p>
@code{
DateTime? myDate;
void DateChanged(DateTime? value)
{
Console.WriteLine($"Date Changed: {value}");
}
}
Validation Sample
@page "/"
@using System.ComponentModel.DataAnnotations
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
<EditForm Model="@Model" OnValidSubmit="Submit">
<DataAnnotationsValidator />
<ValidationSummary/>
<div class="row" style="direction:rtl">
<div class="col-md-4">
<InputText class="form-control" @bind-Value="Model.Name" />
</div>
<div class="col-12"></div>
<div class="col-md-4 mt-3">
<PersianDatePicker @bind-Date="Model.BirthDate"
PlaceHolder="تاریخ تولد"
Label="تاریخ تولد:"
DarkMode="false"
For="()=>Model.BirthDate"
Immediate="true"/>
</div>
<div class="col-12 mt-2">
<button class="btn btn-primary" type="submit">Submit</button>
</div>
</div>
</EditForm>
<p class="mt-2">@Model.BirthDate</p>
@code{
Student Model { get; set; } = new();
public class Student
{
public string Name { get; set; }
[Required(ErrorMessage ="تاریخ تولد اجباری است")]
public DateTime? BirthDate { get; set; }
}
void Submit()
{
}
}
Screenshots
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- DartSassBuilder (>= 1.1.0)
- Microsoft.AspNetCore.Components.Web (>= 8.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.