コード例 #1
0
        void INoDesiredSizeControl.InvalidateUI()
        {
            if (!this.arrangePassed || !this.IsTemplateApplied)
            {
                return;
            }

            this.availableSize     = new Size(0, 0);
            this.lastLayoutContext = ChartLayoutContext.Invalid;

            // reset the layout context of each presenter
            foreach (UIElement child in this.renderSurface.Children)
            {
                PresenterBase presenter = child as PresenterBase;
                if (presenter != null)
                {
                    presenter.lastLayoutContext = ChartLayoutContext.Invalid;
                }
            }

            this.InvalidateArrange();

            if (this.invalidateScheduled)
            {
                this.skipInvalidated = true;
            }
        }
コード例 #2
0
        /// <summary>
        /// Updates of all of the chart elements presented by this instance.
        /// </summary>
        internal override void UpdateUICore(ChartLayoutContext context)
        {
            base.UpdateUICore(context);

            // update the UI of each presenter
            foreach (UIElement child in this.renderSurface.Children)
            {
                PresenterBase presenter = child as PresenterBase;
                if (presenter != null)
                {
                    presenter.UpdateUI(context);
                }
            }

            // position the plot area decoraction
            RadRect plotAreaSlot = this.PlotAreaDecorationSlot;

            Canvas.SetLeft(this.plotAreaBackground, plotAreaSlot.X);
            Canvas.SetTop(this.plotAreaBackground, plotAreaSlot.Y);
            this.plotAreaBackground.Width  = plotAreaSlot.Width;
            this.plotAreaBackground.Height = plotAreaSlot.Height;

            this.adornerLayer.IsHitTestVisible = !context.IsEmpty;
            this.labelLayer.Opacity            = context.IsEmpty ? 0 : 1;

            this.StackedSeriesContext.Clear();
        }
コード例 #3
0
        /// <summary>
        /// Indicates whether the visual can be drawn using the Composition API.
        /// </summary>
        /// <param name="visualElement">The visual element that needs to be drawn.</param>
        /// <returns>Return true if the visual element does not have set Styles and Templates - returns false if it has.</returns>
        protected internal virtual bool CanDrawContainerVisual(PresenterBase visualElement)
        {
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                return(false);
            }

            var axis = visualElement as Axis;

            if (axis != null)
            {
                if (axis is CartesianAxis)
                {
                    return(axis.ReadLocalValue(Axis.LineStyleProperty) == DependencyProperty.UnsetValue &&
                           axis.ReadLocalValue(Axis.MajorTickTemplateProperty) == DependencyProperty.UnsetValue &&
                           axis.ReadLocalValue(Axis.MajorTickStyleProperty) == DependencyProperty.UnsetValue);
                }

                return(false);
            }

            var pointTemplateSeries = visualElement as PointTemplateSeries;

            if (pointTemplateSeries != null)
            {
                if (pointTemplateSeries is AreaSeries || pointTemplateSeries is PointSeries || pointTemplateSeries is SplineSeries ||
                    pointTemplateSeries is ScatterSplineSeries || pointTemplateSeries is PolarSeries || (pointTemplateSeries.GetType() == typeof(ScatterPointSeries)))
                {
                    return(false);
                }

                return(pointTemplateSeries.ReadLocalValue(PointTemplateSeries.DefaultVisualStyleProperty) == DependencyProperty.UnsetValue &&
                       pointTemplateSeries.ReadLocalValue(PointTemplateSeries.PointTemplateProperty) == DependencyProperty.UnsetValue &&
                       pointTemplateSeries.ReadLocalValue(PointTemplateSeries.PointTemplateSelectorProperty) == DependencyProperty.UnsetValue);
            }

            var cartesianChartGrid = visualElement as CartesianChartGrid;

            if (cartesianChartGrid != null)
            {
                return(cartesianChartGrid.ReadLocalValue(CartesianChartGrid.MajorXLineStyleProperty) == DependencyProperty.UnsetValue &&
                       cartesianChartGrid.ReadLocalValue(CartesianChartGrid.MajorYLineStyleProperty) == DependencyProperty.UnsetValue);
            }

            var macdhIndicator = visualElement as MacdhIndicator;

            if (macdhIndicator != null)
            {
                return(macdhIndicator.ReadLocalValue(MacdhIndicator.PointTemplateProperty) == DependencyProperty.UnsetValue &&
                       macdhIndicator.ReadLocalValue(MacdhIndicator.PointTemplateSelectorProperty) == DependencyProperty.UnsetValue &&
                       macdhIndicator.ReadLocalValue(BarIndicatorBase.DefaultVisualStyleProperty) == DependencyProperty.UnsetValue);
            }

            return(true);
        }
コード例 #4
0
        internal virtual RadSize MeasureLabel(FrameworkElement visual, ChartSeriesLabelUpdateContext context)
        {
            if (context.Definition.Strategy != null)
            {
                if ((context.Definition.Strategy.Options & LabelStrategyOptions.Measure) == LabelStrategyOptions.Measure)
                {
                    return(context.Definition.Strategy.GetLabelDesiredSize(context.Point, visual, context.DefinitionIndex));
                }
            }

            return(PresenterBase.MeasureVisual(visual));
        }
コード例 #5
0
        internal virtual void ProcessPaletteChanged(bool force)
        {
            if (!this.IsTemplateApplied)
            {
                return;
            }

            // update the UI of each presenter
            foreach (UIElement child in this.renderSurface.Children)
            {
                PresenterBase presenter = child as PresenterBase;
                if (presenter != null)
                {
                    presenter.UpdatePalette(force);
                }
            }
        }