-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomCellViewProvider.cs
More file actions
32 lines (27 loc) · 1.09 KB
/
Copy pathCustomCellViewProvider.cs
File metadata and controls
32 lines (27 loc) · 1.09 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
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 CustomDayViewProviders.iOS {
public class CustomCellViewProvider : IViewProvider {
Queue<UIView> viewCache = new Queue<UIView>();
public void BindView(UIView view, NSObject viewInfo, ItemViewModel viewModel) {
((CustomCell)view).ViewInfo = (DXCellItemViewInfo)viewInfo;
}
public int GetStubColor(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
return ((DayViewCellViewModel)viewModel).BackgroundColor.ToArgb();
}
public void RecycleView(UIView view) {
this.viewCache.Enqueue(view);
}
public UIView RequestView(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
if (this.viewCache.Count != 0)
return this.viewCache.Dequeue();
return new CustomCell();
}
}
}