コード例 #1
0
        protected override void OnRender(DrawingContext drawingContext)
        {
            var dc = drawingContext;

            dc.DrawRectangle(Brushes.LightGreen, null, new Rect(RenderSize));

            Plotter2D plotter = (Plotter2D)Plotter.GetPlotter(this);

            if (plotter == null)
            {
                return;
            }
            if (data == null)
            {
                return;
            }
            if (renderer == null)
            {
                return;
            }

            CoordinateTransform transform = plotter.Transform.WithRects(new DataRect(0, 0, 1, 1), new Rect(RenderSize));

            foreach (var dataItem in data)
            {
                renderer.DataContext = dataItem;
                renderer.Render(dc, transform);
            }
        }
コード例 #2
0
        private static void OnLongOperationRunningChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Plotter         plotter = null;
            IPlotterElement element = d as IPlotterElement;

            if (element == null)
            {
                plotter = Plotter.GetPlotter(d);
            }
            else
            {
                plotter = element.Plotter;
            }

            if (plotter != null)
            {
                var indicator = plotter.Children.OfType <LongOperationsIndicator>().FirstOrDefault();
                if (indicator != null)
                {
                    indicator.OnLongOperationRunningChanged(element, (bool)e.NewValue);
                }
            }
        }