Example #1
0
 private void RenderVisuals(VisualContext context)
 {
     foreach (Visual visual in visuals)
     {
         DataSeriesVisual sourceVisual = visual as DataSeriesVisual;
         System.Diagnostics.Debug.Assert(sourceVisual != null, "sourceVisual != null");
         sourceVisual.Render(context);
     }
 }
Example #2
0
        private object ItemHitTest(Point pt)
        {
            foreach (Visual visual in visuals)
            {
                DataSeriesVisual sourceVisual = visual as DataSeriesVisual;
                System.Diagnostics.Debug.Assert(sourceVisual != null, "sourceVisual != null");
                if (sourceVisual != null)
                {
                    HitTestResult result = VisualTreeHelper.HitTest(sourceVisual, pt);

                    if (result != null && (result.VisualHit is DataSeriesVisual || result.VisualHit is DataPointVisual))
                    {
                        return(result.VisualHit);
                    }
                }
            }
            return(null);
        }
Example #3
0
        protected override Size MeasureOverride(Size availableSize)
        {
            Rect rect = Rect.Empty;

            foreach (Visual visual in visuals)
            {
                DataSeriesVisual sourceVisual = visual as DataSeriesVisual;
                System.Diagnostics.Debug.Assert(sourceVisual != null, "sourceVisual != null");

                rect.Union(sourceVisual.ContentBounds);
                rect.Union(sourceVisual.DescendantBounds);
            }

            if (rect.IsEmpty || double.IsInfinity(rect.Width) || double.IsInfinity(rect.Height))
            {
                return(new Size(0, 0));
            }

            return(new Size(rect.Width, rect.Height));
        }