Beispiel #1
0
        /// <summary>
        /// Called when the paint context changed.
        /// </summary>
        protected override void OnPaintContextChanged()
        {
            var context = new PaintContext <TDrawingContext>();

            var w  = LegendShapeSize;
            var sh = 0f;

            if (Stroke != null)
            {
                var strokeClone = Stroke.CloneTask();
                var visual      = new TVisual
                {
                    X          = 0,
                    Y          = 0,
                    Height     = (float)LegendShapeSize,
                    Width      = (float)LegendShapeSize,
                    CenterX    = (float)LegendShapeSize * 0.5f,
                    CenterY    = (float)LegendShapeSize * 0.5f,
                    StartAngle = 0,
                    SweepAngle = 359.9999f
                };
                sh = strokeClone.StrokeThickness;
                strokeClone.ZIndex = 1;
                w += 2 * strokeClone.StrokeThickness;
                strokeClone.AddGeometyToPaintTask(visual);
                _ = context.PaintTasks.Add(strokeClone);
            }

            if (Fill != null)
            {
                var fillClone = Fill.CloneTask();
                var visual    = new TVisual
                {
                    X          = sh,
                    Y          = sh,
                    Height     = (float)LegendShapeSize,
                    Width      = (float)LegendShapeSize,
                    CenterX    = (float)LegendShapeSize * 0.5f,
                    CenterY    = (float)LegendShapeSize * 0.5f,
                    StartAngle = 0,
                    SweepAngle = 359.9999f
                };
                fillClone.AddGeometyToPaintTask(visual);
                _ = context.PaintTasks.Add(fillClone);
            }

            context.Width  = w;
            context.Height = w;

            paintContext = context;
            OnPropertyChanged(nameof(DefaultPaintContext));
        }
Beispiel #2
0
        protected override void OnPaintContextChanged()
        {
            var context = new PaintContext <TDrawingContext>();

            if (Fill != null)
            {
                var fillClone = Fill.CloneTask();
                var visual    = new TVisual
                {
                    X          = 0,
                    Y          = 0,
                    Height     = (float)LegendShapeSize,
                    Width      = (float)LegendShapeSize,
                    CenterX    = (float)LegendShapeSize * 0.5f,
                    CenterY    = (float)LegendShapeSize * 0.5f,
                    StartAngle = 0,
                    SweepAngle = 359.9999f
                };
                fillClone.AddGeometyToPaintTask(visual);
                context.PaintTasks.Add(fillClone);
            }

            var w = LegendShapeSize;

            if (Stroke != null)
            {
                var strokeClone = Stroke.CloneTask();
                var visual      = new TVisual
                {
                    X          = 0,
                    Y          = 0,
                    Height     = (float)LegendShapeSize,
                    Width      = (float)LegendShapeSize,
                    CenterX    = (float)LegendShapeSize * 0.5f,
                    CenterY    = (float)LegendShapeSize * 0.5f,
                    StartAngle = 0,
                    SweepAngle = 359.9999f
                };
                w += 2 * strokeClone.StrokeWidth;
                strokeClone.AddGeometyToPaintTask(visual);
                context.PaintTasks.Add(strokeClone);
            }

            context.Width  = w;
            context.Height = w;

            paintContext = context;
        }
Beispiel #3
0
        /// <summary>
        /// Called when the paint context changes.
        /// </summary>
        protected override void OnPaintContextChanged()
        {
            var context = new PaintContext <TDrawingContext>();

            var w  = LegendShapeSize;
            var sh = 0f;

            if (Stroke != null)
            {
                var strokeClone = Stroke.CloneTask();
                var visual      = new TVisual
                {
                    X      = strokeClone.StrokeThickness,
                    Y      = strokeClone.StrokeThickness,
                    Height = (float)LegendShapeSize,
                    Width  = (float)LegendShapeSize
                };
                sh = strokeClone.StrokeThickness;
                strokeClone.ZIndex = 1;
                w += 2 * strokeClone.StrokeThickness;
                strokeClone.AddGeometyToPaintTask(visual);
                _ = context.PaintTasks.Add(strokeClone);
            }

            if (Fill != null)
            {
                var fillClone = Fill.CloneTask();
                var visual    = new TVisual {
                    X = sh, Y = sh, Height = (float)LegendShapeSize, Width = (float)LegendShapeSize
                };
                fillClone.AddGeometyToPaintTask(visual);
                _ = context.PaintTasks.Add(fillClone);
            }

            context.Width  = w;
            context.Height = w;

            paintContext = context;
        }
Beispiel #4
0
        /// <summary>
        /// Called when the paint context changes.
        /// </summary>
        protected override void OnPaintContextChanged()
        {
            var context = new PaintContext <TDrawingContext>();
            var w       = LegendShapeSize;
            var sh      = 0f;

            if (Stroke != null)
            {
                var strokeClone = Stroke.CloneTask();
                var visual      = new TVisual
                {
                    X      = strokeClone.StrokeThickness,
                    Y      = strokeClone.StrokeThickness,
                    Height = (float)LegendShapeSize,
                    Width  = (float)LegendShapeSize
                };
                sh = strokeClone.StrokeThickness;
                strokeClone.ZIndex = 1;
                w += 2 * strokeClone.StrokeThickness;
                context.PaintTasksSchedule.Add(new PaintTaskSchedule <TDrawingContext>(strokeClone, visual));
            }

            if (Fill != null)
            {
                var fillClone = Fill.CloneTask();
                var visual    = new TVisual {
                    X = sh, Y = sh, Height = (float)LegendShapeSize, Width = (float)LegendShapeSize
                };
                context.PaintTasksSchedule.Add(new PaintTaskSchedule <TDrawingContext>(fillClone, visual));
            }

            context.Width  = w;
            context.Height = w;

            paintContext = context;

            OnPropertyChanged(nameof(DefaultPaintContext));
        }
Beispiel #5
0
        /// <summary>
        /// Called when the paint context changes.
        /// </summary>
        protected override void OnSeriesMiniatureChanged()
        {
            var context = new CanvasSchedule <TDrawingContext>();
            var w       = LegendShapeSize;
            var sh      = 0f;

            if (Stroke is not null)
            {
                var strokeClone = Stroke.CloneTask();
                var visual      = new TVisual
                {
                    X      = strokeClone.StrokeThickness,
                    Y      = strokeClone.StrokeThickness,
                    Height = (float)LegendShapeSize,
                    Width  = (float)LegendShapeSize
                };
                sh = strokeClone.StrokeThickness;
                strokeClone.ZIndex = 1;
                w += 2 * strokeClone.StrokeThickness;
                context.PaintSchedules.Add(new PaintSchedule <TDrawingContext>(strokeClone, visual));
            }

            if (Fill is not null)
            {
                var fillClone = Fill.CloneTask();
                var visual    = new TVisual {
                    X = sh, Y = sh, Height = (float)LegendShapeSize, Width = (float)LegendShapeSize
                };
                context.PaintSchedules.Add(new PaintSchedule <TDrawingContext>(fillClone, visual));
            }

            context.Width  = w;
            context.Height = w;

            canvaSchedule = context;

            OnPropertyChanged(nameof(CanvasSchedule));
        }