Esempio n. 1
0
        private void GetView()
        {
            Content = new NControlView((ICanvas canvas, Rect rect) =>
            {
                if (CheckThickness <= 0)
                {
                    CheckThickness = WidthRequest / 10;
                }

                canvas.DrawRectangle(rect, new NGraphics.Size(-5), pen: new Pen(BorderColor.ToNColor(), BorderThickness), brush: new SolidBrush(FillColor.ToNColor()));


                if (IsChecked)
                {
                    canvas.DrawLine(new NGraphics.Point(rect.Width.PerctPoint(20), rect.Height.PerctPoint(50d)), new NGraphics.Point(rect.Width.PerctPoint(40), rect.Height.PerctPoint(80)), new Pen(CheckColor.ToNColor(), CheckThickness));
                    canvas.DrawLine(new NGraphics.Point(rect.Width.PerctPoint(35), rect.Height.PerctPoint(80)), new NGraphics.Point(rect.Width.PerctPoint(80), rect.Height.PerctPoint(30)), new Pen(CheckColor.ToNColor(), CheckThickness));
                }
            });
        }