Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hesamdarbandi/XamPersianCalendar
Xamarin Form Persian Calendar
https://github.com/hesamdarbandi/XamPersianCalendar
Last synced: 29 days ago
JSON representation
Xamarin Form Persian Calendar
- Host: GitHub
- URL: https://github.com/hesamdarbandi/XamPersianCalendar
- Owner: hesamdarbandi
- License: other
- Created: 2020-06-19T05:58:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-19T05:59:06.000Z (over 4 years ago)
- Last Synced: 2024-08-03T23:25:52.032Z (4 months ago)
- Language: C#
- Size: 355 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - XamarinFormPersianCalendar ★1
README
# XamarinFormPersianCalendar
Persian Calendar Control For XamarinFroms#### Usage
In Your View Add add the xmlns namespace
xmlns:cl="clr-namespace:XamPersianCalendar;assembly=XamPersianCalendar"
Then add the xaml
```xml
```
Then Add Bindable Property And Command to your ViewModel
```
public class MainViewModel : BindableObject
{
private ObservableCollection _dates;
private string _selectDate;public MainViewModel()
{
_dates = new ObservableCollection()
{
DateTime.Now
};
}public ObservableCollection Dates
{
get { return _dates; }
set
{
_dates = value;
OnPropertyChanged();
}
}public string SelectDate
{
get { return _selectDate; }
set
{
_selectDate = value;
OnPropertyChanged();
}
}public ICommand SelectedDateCommand => new Command(() => OnSelectedDate());
private void OnSelectedDate()
{
if (Dates.Any())
{
var date = Dates.LastOrDefault();
SelectDate = date != null ? date.ToPersianDate("/") : string.Empty;
}
}
}
```