This question is locked. New answers and comments are not allowed.
Hello
I want to achieve something similar to this:
http://s18.postimg.org/66xq6aemh/Screenshot_2015_05_21_18_08_58.png
I am using the UI fo Xamarin forms but I am using a custom renderer, in the Android version I have extended the CalendarDayCell:
Here is my custom renderer:
public class CustomCalendarRenderer : ViewRenderer<
CustomCalendar
, TKCalendar>
{
CustomCalendar calendar;
TKCalendar calendarView;
protected override void OnElementChanged(ElementChangedEventArgs<
CustomCalendar
> e)
{
try
{
base.OnElementChanged(e);
if (e.NewElement == null)
return;
calendar = e.NewElement;
calendarView = new TKCalendar(this.Bounds);
AppointmentCalendarDelegate calendarDelegate;
calendarView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
calendarDelegate = new AppointmentCalendarDelegate();
calendarView.Delegate = calendarDelegate;
calendarDelegate.SelectionChanged += calendarDelegate_SelectionChanged;
//this.calendarView.MinDate = this.calendar.MinDate.ToNSDate();
//this.calendarView.MaxDate = this.calendar.MaxDate.ToNSDate();
calendarView.Locale = new NSLocale("es_MX");
calendarView.Update(false);
if (calendar.Type == 2)
{
calendarView.ViewMode = TKCalendarViewMode.Year;
}
SetNativeControl(this.calendarView);
}
catch
{
//Ignored
}
}
void calendarDelegate_SelectionChanged(object sender, ValueChangedEventArgs<
object
> e)
{
this.calendar.SelectedDate = (DateTime?)e.NewValue;
}
}
Please let me know your comments/suggestions