-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomAppointmentViewProvider.cs
More file actions
38 lines (32 loc) · 1.49 KB
/
CustomAppointmentViewProvider.cs
File metadata and controls
38 lines (32 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using DevExpress.Xamarin.iOS.Scheduler;
using DevExpress.XamarinForms.Scheduler;
using DevExpress.XamarinForms.Scheduler.Internal;
using DevExpress.XamarinForms.Scheduler.iOS;
using Foundation;
using UIKit;
namespace CustomMonthViewProviders.iOS {
public class CustomAppointmentViewProvider : IViewProvider {
Queue<UIView> cache = new Queue<UIView>();
public void BindView(UIView view, NSObject viewInfo, ItemViewModel viewModel) {
CustomAppointmentView appointmentView = (CustomAppointmentView)view;
DXAppItemViewInfo appointmentViewInfo = (DXAppItemViewInfo)viewInfo;
appointmentView.BackgroundColor = appointmentViewInfo.BackgroundColor;
appointmentView.SubjectLabel.Text = appointmentViewInfo.Text;
appointmentView.SubjectLabel.Font = appointmentViewInfo.TextFont;
appointmentView.SubjectLabel.TextColor = appointmentViewInfo.TextColor;
}
public int GetStubColor(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
return ((AppointmentViewModel)viewModel).BackgroundColor.ToArgb();
}
public void RecycleView(UIView view) {
this.cache.Enqueue(view);
}
public UIView RequestView(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
if (this.cache.Count != 0)
return this.cache.Dequeue();
return new CustomAppointmentView();
}
}
}