Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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

```