-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomDateHeaderViewProvider.cs
More file actions
36 lines (31 loc) · 1.58 KB
/
Copy pathCustomDateHeaderViewProvider.cs
File metadata and controls
36 lines (31 loc) · 1.58 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 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 CustomDateHeaderViewProvider : IViewProvider {
public void BindView(UIView view, NSObject viewInfo, ItemViewModel viewModel) {
CustomDateHeader headerView = (CustomDateHeader)view;
DayViewHeaderItemViewModel headerViewModel = (DayViewHeaderItemViewModel)viewModel;
DXDayHeaderItemViewInfo headerViewInfo = (DXDayHeaderItemViewInfo)viewInfo;
headerView.BackgroundColor = headerViewInfo.BackgroundColor;
headerView.WeekDay.Font = headerViewInfo.WeekDayFont;
headerView.WeekDay.TextColor = headerViewInfo.WeekDayFontColor;
headerView.WeekDay.Text = headerViewInfo.WeekDay;
headerView.DayNumber.Font = headerViewInfo.DayFont;
headerView.DayNumber.TextColor = headerViewModel.IsToday ? headerViewInfo.WeekDayFontColor : headerViewInfo.DayFontColor;
headerView.DayNumber.Text = headerViewInfo.Day;
}
public int GetStubColor(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
return ((DayViewHeaderItemViewModel)viewModel).BackgroundColor.ToArgb();
}
public void RecycleView(UIView view) {
}
public UIView RequestView(int logicalIndex, NSObject viewInfo, ItemViewModel viewModel) {
return new CustomDateHeader();
}
}
}