-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomCellViewProvider.cs
More file actions
36 lines (31 loc) · 1.35 KB
/
Copy pathCustomCellViewProvider.cs
File metadata and controls
36 lines (31 loc) · 1.35 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
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 CustomCellViewProvider : IViewProvider {
Queue<UIView> cache = new Queue<UIView>();
public void BindView(UIView view, NSObject viewInfo, ItemViewModel viewModel) {
CustomCellView cellView = (CustomCellView)view;
cellView.ViewInfo = (DXMonthCellItemViewInfo)viewInfo;
MonthViewCellViewModel cellViewModel = ((MonthViewCellViewModel)viewModel);
cellView.ShowMoreButton = cellViewModel.ShowDownMoreButton;
cellView.CellHeaderHeight = cellViewModel.DayNumberHeight;
}
public int GetStubColor(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
return ((CellViewModel)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 CustomCellView();
}
}
}