-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCustomCell.cs
More file actions
44 lines (39 loc) · 1.47 KB
/
Copy pathCustomCell.cs
File metadata and controls
44 lines (39 loc) · 1.47 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
39
40
41
42
43
44
using System;
using CoreGraphics;
using DevExpress.Xamarin.iOS.Scheduler;
using UIKit;
namespace CustomDayViewProviders.iOS {
public class CustomCell : UIView {
private DXCellItemViewInfo viewInfo;
public CustomCell() {
}
public DXCellItemViewInfo ViewInfo {
get { return this.viewInfo; }
set {
if (this.viewInfo == value)
return;
this.viewInfo = value;
BackgroundColor = this.viewInfo.BackgroundColor;
}
}
public override void Draw(CGRect rect) {
CGContext ctx = UIGraphics.GetCurrentContext();
if (ViewInfo.LeftBorderThickness > 0) {
ctx.SetStrokeColor(ViewInfo.LeftBorderColor.CGColor);
ctx.SetLineWidth((nfloat)ViewInfo.LeftBorderThickness);
ctx.BeginPath();
ctx.MoveTo(rect.GetMinX(), rect.GetMinY());
ctx.AddLineToPoint(rect.GetMinX(), rect.GetMaxY());
ctx.StrokePath();
}
if (ViewInfo.BottomBorderThickness > 0) {
ctx.SetStrokeColor(ViewInfo.BottomBorderColor.CGColor);
ctx.SetLineWidth((nfloat)ViewInfo.BottomBorderThickness);
ctx.BeginPath();
ctx.MoveTo(rect.GetMinX(), rect.GetMaxY());
ctx.AddLineToPoint(rect.GetMaxX(), rect.GetMaxY());
ctx.StrokePath();
}
}
}
}