void IPlotterElement.OnPlotterDetaching(Plotter plotter)
		{
			this.plotter.Viewport.PropertyChanged -= OnViewportPropertyChanged;
			this.plotter.Viewport.DomainChanged -= OnViewportDomainChanged;

			GetHostPanel(plotter).Children.Remove(scrollBar);

			UpdateScrollBar(null);

			this.plotter = null;
		}
		void IPlotterElement.OnPlotterAttached(Plotter plotter)
		{
			GetHostPanel(plotter).Children.Add(scrollBar);

			Plotter2D plotter2d = (Plotter2D)plotter;
			this.plotter = plotter2d;
			var viewport = plotter2d.Viewport;
			viewport.PropertyChanged += OnViewportPropertyChanged;
			viewport.DomainChanged += OnViewportDomainChanged;

			UpdateScrollBar(viewport);
		}
		public virtual void OnPlotterAttached(Plotter plotter)
		{
			this.plotter = (Plotter2D)plotter;
			viewport = this.plotter.Viewport;

			if (!IsMarkersHost)
			{
				plotter.CentralGrid.Children.Add(hostingCanvas);
			}
			if (Parent == null)
			{
				hostingCanvas.Children.Add(this);
			}
			this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
		}
        /// <summary>
        /// Adds the line chart with specified items source to plotter.
        /// </summary>
        /// <param name="plotter">The plotter.</param>
        /// <param name="data">The data.</param>
        /// <returns>An instance of LineChart.</returns>
        public static LineChart AddLineChart(this Plotter2D plotter, object data)
        {
            if (plotter == null)
            {
                throw new ArgumentNullException("plotter");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            LineChart chart = new LineChart {
                ItemsSource = data
            };

            plotter.Children.Add(chart);

            return(chart);
        }
示例#5
0
        protected internal Viewport2D(FrameworkElement host, Plotter2D plotter)
        {
            hostElement = host;
            host.ClipToBounds = true;
            host.SizeChanged += OnHostElementSizeChanged;

            this.plotter = plotter;
            plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

            constraints = new ConstraintCollection(this);
			constraints.Add(new MinimalSizeConstraint());
			constraints.CollectionChanged += constraints_CollectionChanged;

			fitToViewConstraints = new ConstraintCollection(this);
			fitToViewConstraints.CollectionChanged += fitToViewConstraints_CollectionChanged;

            readonlyContentBoundsHosts = new ReadOnlyObservableCollection<DependencyObject>(contentBoundsHosts);

            UpdateVisible();
            UpdateTransform();
        }
示例#6
0
        protected internal Viewport2D(FrameworkElement host, Plotter2D plotter)
        {
            hostElement       = host;
            host.ClipToBounds = true;
            host.SizeChanged += OnHostElementSizeChanged;

            this.plotter = plotter;
            plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

            constraints = new ConstraintCollection(this);
            constraints.Add(new MinimalSizeConstraint());
            constraints.CollectionChanged += constraints_CollectionChanged;

            fitToViewConstraints = new ConstraintCollection(this);
            fitToViewConstraints.CollectionChanged += fitToViewConstraints_CollectionChanged;

            readonlyContentBoundsHosts = new ReadOnlyObservableCollection <DependencyObject>(contentBoundsHosts);

            UpdateVisible();
            UpdateTransform();
        }
示例#7
0
		internal Viewport2D(FrameworkElement host, Plotter2D plotter)
		{
			this.hostElement = host;
			host.ClipToBounds = true;
			host.SizeChanged += new SizeChangedEventHandler(OnHostElementSizeChanged);

			this.plotter = plotter;
			plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

			restrictions = new RestrictionCollection(this);
			restrictions.Add(new MinimalSizeRestriction());
			restrictions.CollectionChanged += restrictions_CollectionChanged;

			fitToViewRestrictions = new RestrictionCollection(this);
			fitToViewRestrictions.CollectionChanged += fitToViewRestrictions_CollectionChanged;

			readonlyContentBoundsHosts = new ReadOnlyObservableCollection<IPlotterElement>(contentBoundsHosts);

			UpdateVisible();
			UpdateTransform();
		}
示例#8
0
		void IPlotterElement.OnPlotterDetaching(Plotter plotter)
		{
			plotter.Children.CollectionChanged -= OnPlotterChildrenChanged;
			GetHostPanel(plotter).Children.Remove(this);

			this.plotter = null;
		}
示例#9
0
		void IPlotterElement.OnPlotterAttached(Plotter plotter)
		{
			plotter.Children.CollectionChanged += OnPlotterChildrenChanged;
			GetHostPanel(plotter).Children.Add(this);

			this.plotter = (Plotter2D)plotter;

			UpdateVisible();
		}
示例#10
0
		public void OnPlotterDetaching(Plotter plotter)
		{
			plotter.CentralGrid.Children.Remove(this);
			this.plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;
			this.plotter = null;
		}
示例#11
0
 /// <summary>
 /// Adds one dimensional graph.
 /// </summary>
 /// <param name="pointSource">The point source.</param>
 /// <param name="lineColor">Color of the line.</param>
 /// <param name="lineThickness">The line thickness.</param>
 /// <returns></returns>
 public static LineGraph AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, Color lineColor, double lineThickness)
 {
     return(AddLineGraph(plotter, pointSource, new Pen(new SolidColorBrush(lineColor), lineThickness), null));
 }
示例#12
0
 public void OnPlotterDetaching(Plotter plotter)
 {
     plotter.CentralGrid.Children.Remove(this);
     this.plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;
     this.plotter = null;
 }
		public void OnPlotterAttached(Plotter plotter)
		{
			if (Parent == null)
			{
				hostPanel = new ViewportHostPanel();
                Viewport2D.SetIsContentBoundsHost(hostPanel, false);
				hostPanel.Children.Add(this);

				plotter.Dispatcher.BeginInvoke(() =>
				{
					plotter.Children.Add(hostPanel);
				}, DispatcherPriority.Send);
			}
#if !old
			Canvas hostCanvas = (Canvas)hostPanel.FindName(canvasName);
			if (hostCanvas == null)
			{
				hostCanvas = new Canvas { ClipToBounds = true };
				Panel.SetZIndex(hostCanvas, 1);

				INameScope nameScope = NameScope.GetNameScope(hostPanel);
				if (nameScope == null)
				{
					nameScope = new NameScope();
					NameScope.SetNameScope(hostPanel, nameScope);
				}

				hostPanel.RegisterName(canvasName, hostCanvas);
				hostPanel.Children.Add(hostCanvas);
			}

			hostCanvas.Children.Add(this);
#else
#endif

			Plotter2D plotter2d = (Plotter2D)plotter;
			this.plotter = plotter2d;
		}
示例#14
0
		void IPlotterElement.OnPlotterAttached(Plotter plotter)
		{
			plotter.MainCanvas.Children.Add(this);

			Plotter2D plotter2d = (Plotter2D)plotter;
			this.plotter = plotter2d;
			plotter2d.Viewport.PropertyChanged += Viewport_PropertyChanged;

			UpdateUIRepresentation();
		}
示例#15
0
		void IPlotterElement.OnPlotterDetaching(Plotter plotter)
		{
			Plotter2D plotter2d = (Plotter2D)plotter;
			plotter2d.Viewport.PropertyChanged -= Viewport_PropertyChanged;
			plotter.MainCanvas.Children.Remove(this);

			this.plotter = null;
		}
        protected override void OnPlotterDetaching(Plotter plotter)
        {
            base.OnPlotterDetaching(plotter);

            viewport.PropertyChanged -= OnViewportPropertyChanged;
            viewport = null;
            GetHostPanel(plotter).Children.Remove(this);
            plotter2D = null;
        }
        protected override void OnPlotterAttached(Plotter plotter)
        {
            base.OnPlotterAttached(plotter);

            plotter2D = (Plotter2D)plotter;
            GetHostPanel(plotter).Children.Add(this);
            viewport = plotter2D.Viewport;
            viewport.PropertyChanged += OnViewportPropertyChanged;
        }
示例#18
0
		protected override void OnPlotterDetaching(Plotter2D plotter)
		{
		}
示例#19
0
 internal InjectedViewport2D(FrameworkElement host, Plotter2D plotter) : base(host, plotter)
 {
 }
示例#20
0
 public void OnPlotterAttached(Plotter plotter)
 {
     if (this.plotter == null)
     {
         Plotter2D p = (Plotter2D)plotter;
         this.plotter = p;
         plotter.Children.CollectionChanged += OnPlotterChildrenChanged;
         GetHostPanel(plotter).Children.Add(this);
     }
     UpdateVisible();
 }
		internal InjectedViewport2D(FrameworkElement host, Plotter2D plotter) : base(host, plotter) { }
		public void OnPlotterDetaching(Plotter plotter)
		{
			Plotter2D plotter2d = (Plotter2D)plotter;

#if !old
			Canvas hostCanvas = (Canvas)hostPanel.FindName(canvasName);

			if (hostCanvas.Children.Count == 1)
			{
				// only this ViewportUIContainer left
				hostPanel.Children.Remove(hostCanvas);
			}
			hostCanvas.Children.Remove(this);
#else
			if (hostPanel != null)
			{
				hostPanel.Children.Remove(this);
			}
			plotter.Dispatcher.BeginInvoke(() =>
			{
				plotter.Children.Remove(hostPanel);
			}, DispatcherPriority.Send);
#endif

			this.plotter = null;
		}
示例#23
0
		protected override void OnPlotterDetaching(Plotter2D plotter)
		{
			base.OnPlotterDetaching(plotter);
		}
示例#24
0
 public void OnPlotterDetaching(Plotter plotter)
 {
     if (this.plotter != null)
     {
         plotter.Children.CollectionChanged -= OnPlotterChildrenChanged;
         GetHostPanel(plotter).Children.Remove(this);
         this.plotter = null;
     }
 }
示例#25
0
 /// <summary>
 /// Adds one dimensional graph with specified color of line.
 /// </summary>
 /// <param name="pointSource">The point source.</param>
 /// <param name="lineColor">Color of the line.</param>
 /// <returns></returns>
 public static LineGraph AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, Color lineColor)
 {
     return(AddLineGraph(plotter, pointSource, lineColor, 1));
 }
		public virtual void OnPlotterDetaching(Plotter plotter)
		{
			this.plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;

			if (!IsMarkersHost)
			{
				plotter.CentralGrid.Children.Remove(hostingCanvas);
			}
			hostingCanvas.Children.Remove(this);

			this.plotter = null;
		}
		public void OnPlotterAttached(Plotter plotter)
		{
			this.plotter = (Plotter2D)plotter;
			plotter.Children.BeginAdd(renderPanel);
			modeHandler.Attach(this, plotter);
		}
示例#28
0
 /// <summary>
 /// Adds one dimensional graph with random color if line.
 /// </summary>
 /// <param name="pointSource">The point source.</param>
 /// <param name="lineThickness">The line thickness.</param>
 /// <returns></returns>
 public static LineGraph AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, double lineThickness)
 {
     return(AddLineGraph(plotter, pointSource, ColorHelper.CreateRandomHsbColor(), lineThickness));
 }
		public void OnPlotterDetaching(Plotter plotter)
		{
			modeHandler.Detach();
			plotter.Children.BeginRemove(renderPanel);
			this.plotter = null;
		}
示例#30
0
 protected override void OnPlotterDetaching(d3.Plotter2D plotter)
 {
 }
示例#31
0
		public void OnPlotterAttached(Plotter plotter)
		{
			this.plotter = (Plotter2D)plotter;
			this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;

			plotter.CentralGrid.Children.Add(this);

			Update();
		}