public override void Draw(RectangleF bounds, MonoTouch.CoreGraphics.CGContext context, UIView view)
 {
     if (AutoLoadOnVisible)
     {
         LoadMore();
     }
 }
Esempio n. 2
0
        public override void Draw(RectangleF bounds, MonoTouch.CoreGraphics.CGContext context, UIView view)
        {
            CaptionColor.SetColor();
            var textHeight = Caption.MonoStringHeight(CaptionFont, bounds.Width - PaddingX * 2);

            view.DrawString(Caption, new RectangleF(PaddingX, Padding, bounds.Width - Padding * 2, bounds.Height - Padding * 2), CaptionFont, UILineBreakMode.WordWrap);

            if (Value != null)
            {
                ValueColor.SetColor();
                var valueHeight = Value.MonoStringHeight(ValueFont, bounds.Width - PaddingX * 2);
                view.DrawString(Value, new RectangleF(PaddingX, Padding + textHeight + 6f, bounds.Width - Padding * 2, valueHeight), ValueFont, UILineBreakMode.WordWrap);
            }
        }
Esempio n. 3
0
        public override void Draw(RectangleF bounds, MonoTouch.CoreGraphics.CGContext context, UIView view)
        {
            view.BackgroundColor = UIColor.White;
            CaptionColor.SetColor();
            var width      = bounds.Width - PaddingX * 2;
            var textHeight = Caption.MonoStringHeight(CaptionFont, width);

            view.DrawString(Caption, new RectangleF(PaddingX, PaddingY, width, bounds.Height - PaddingY * 2), CaptionFont, UILineBreakMode.WordWrap);

            if (Value != null)
            {
                ValueColor.SetColor();
                var valueOrigin = new PointF(PaddingX, PaddingY + textHeight + 8f);
                var valueSize   = new SizeF(width, bounds.Height - valueOrigin.Y);
                view.DrawString(Value, new RectangleF(valueOrigin, valueSize), ValueFont, UILineBreakMode.WordWrap);
            }
        }
Esempio n. 4
0
        public override void DrawInContext(MonoTouch.CoreGraphics.CGContext ctx)
        {
            base.DrawInContext(ctx);

            float  radius = Math.Min(this.Bounds.Width, this.Bounds.Height) / 2;
            PointF center = new PointF(this.Bounds.Width / 2, this.Bounds.Height / 2);

            //Background Circle
            ctx.AddEllipseInRect(new RectangleF(center.X, center.Y, radius * 2, radius * 2));
            ctx.SetFillColor(TrackColor.CGColor);
            ctx.FillPath();

            // Elapsed Arc
            ctx.AddArc(center.X, center.Y, radius, StartAngle, (float)(StartAngle + Progress * 2.0f * Math.PI), false);
            ctx.AddLineToPoint(center.X, center.Y);
            ctx.ClosePath();
            ctx.SetFillColor(TintColor.CGColor);
            ctx.FillPath();
        }
Esempio n. 5
0
        public override void Draw(System.Drawing.RectangleF rect)
        {
            base.Draw(rect);

            using (MonoTouch.CoreGraphics.CGContext gfx = UIGraphics.GetCurrentContext())
            {
                using (MonoTouch.CoreGraphics.CGColorSpace rgb =
                           MonoTouch.CoreGraphics.CGColorSpace.CreateDeviceRGB())
                {
                    MonoTouch.CoreGraphics.CGGradient gradient =
                        new MonoTouch.CoreGraphics.CGGradient(rgb,
                                                              new MonoTouch.CoreGraphics.CGColor[] {
                        startColor.CGColor,
                        endColor.CGColor
                    });

                    gfx.DrawLinearGradient(gradient,
                                           new System.Drawing.PointF(rect.Left, rect.Top),
                                           new System.Drawing.PointF(rect.Right, rect.Top),
                                           MonoTouch.CoreGraphics.CGGradientDrawingOptions.DrawsBeforeStartLocation);
                }
            }
        }
Esempio n. 6
0
 public override void DrawLayer(CALayer layer, MonoTouch.CoreGraphics.CGContext context)
 {
     // implement your drawing
 }
Esempio n. 7
0
 public override void DrawInContext(MonoTouch.CoreGraphics.CGContext ctx)
 {
     base.DrawInContext(ctx);
     // implement your drawing
 }
Esempio n. 8
0
 public override void DrawLayer(CALayer layer, MonoTouch.CoreGraphics.CGContext context)
 {
 }