Example #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (!(Template.FindName("canvas", this) is NaturalGeometriesCanvas canvas))
            {
                throw new Exception(
                          $"{nameof(SKElement)} not found. This was probably caused because the control {nameof(CartesianChart)} template was overridden, " +
                          $"If you override the template please add an {nameof(NaturalGeometriesCanvas)} to the template and name it 'canvas'");
            }

            this.canvas = canvas;
            InitializeCore();
        }
Example #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (!(Template.FindName("canvas", this) is NaturalGeometriesCanvas canvas))
            {
                throw new Exception(
                          $"{nameof(SKElement)} not found. This was probably caused because the control {nameof(CartesianChart)} template was overridden, " +
                          $"If you override the template please add an {nameof(NaturalGeometriesCanvas)} to the template and name it 'canvas'");
            }

            this.canvas = canvas;
            core        = new ChartCore <SkiaDrawingContext>(this, canvas.CanvasCore);
            legend      = Template.FindName("legend", this) as IChartLegend <SkiaDrawingContext>;
            tooltip     = Template.FindName("tooltip", this) as IChartTooltip <SkiaDrawingContext>;
            core.Update();
        }