Not sure if this is the Telerik Approved way but it worked (here is the iOS renderer):
public class AppointmentCalendarRenderer : ViewRenderer<
AppointmentCalendar
, TKCalendar>
{
AppointmentCalendar calendar;
TKCalendar calendarView;
AppointmentCalendarDelegate calendarDelegate;
protected override void OnElementChanged(ElementChangedEventArgs<
AppointmentCalendar
> e)
{
try
{
base.OnElementChanged(e);
if (e.NewElement == null)
return;
this.calendar = e.NewElement;
this.calendarView = new TKCalendar(this.Bounds);
this.calendarView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
this.calendarView.MinDate = this.calendar.MinDate.ToNSDate();
this.calendarView.MaxDate = this.calendar.MaxDate.ToNSDate();
this.calendarDelegate = new AppointmentCalendarDelegate();
this.calendarView.Delegate = this.calendarDelegate;
this.calendarDelegate.SelectionChanged += calendarDelegate_SelectionChanged;
SetNativeControl(this.calendarView);
}
catch(Exception ee)
{
}
}
void calendarDelegate_SelectionChanged(object sender, ValueChangedEventArgs<
object
> e)
{
this.calendar.SelectedDate = (DateTime?)e.NewValue;
}
}
public class AppointmentCalendarDelegate : TKCalendarDelegate
{
public event EventHandler<
ValueChangedEventArgs
<object>> SelectionChanged;
private DateTime? previousDisplayDate;
public void Dispose()
{
}
public IntPtr Handle
{
get
{
return default(IntPtr);
}
}
public override void UpdateVisualsForCell(TKCalendar calendar, TKCalendarCell cell)
{
if (cell is TKCalendarDayCell)
{
TKCalendarDayCell dayCell = (TKCalendarDayCell)cell;
if ((dayCell.State & TKCalendarDayState.Selected) != 0)
{
cell.Style.TextColor = UIColor.White;
cell.Style.ShapeStroke = new TKStroke (UIColor.FromRGB(229, 81, 19),7);
cell.Style.ShapeFill = new TKSolidFill (UIColor.FromRGB(229, 81, 19));
}
if ((dayCell.State & TKCalendarDayState.Today) != 0)
{
cell.Style.TextColor = UIColor.Black;
}
}
}
public override void DidSelectDate(TKCalendar calendar, NSDate date)
{
EventHandler<
ValueChangedEventArgs
<object>> eventHandler = this.SelectionChanged;
if (eventHandler != null)
{
eventHandler(this, new ValueChangedEventArgs<
object
>((object)this.previousDisplayDate, (object)new DateTime?(date.ToDateTime())));
}
previousDisplayDate =new DateTime?( date.ToDateTime());
}
}