示例#1
0
        private bool CheckDataInUpdateBounds(NotifyCollectionChangedEventArgs e, PointChartBase chart)
        {
            var dataToPoint = chart.DataSource.DataToPoint;

            if (dataToPoint == null)
            {
                return(true);
            }

            if (e.NewItems != null)
            {
                foreach (var dataItem in e.NewItems)
                {
                    var point = dataToPoint(dataItem);
                    if (increasedVisible.Contains(point))
                    {
                        return(true);
                    }
                }
            }
            if (e.OldItems != null)
            {
                foreach (var dataItem in e.OldItems)
                {
                    var point = dataToPoint(dataItem);
                    if (increasedVisible.Contains(point))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
示例#2
0
        public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                chart.OnAdded(e);
                break;

            case NotifyCollectionChangedAction.Move:
                chart.OnMoved(e);
                break;

            case NotifyCollectionChangedAction.Remove:
                chart.OnRemoved(e);
                break;

            case NotifyCollectionChangedAction.Replace:
                chart.OnReplaced(e);
                break;

            case NotifyCollectionChangedAction.Reset:
                chart.OnReset();
                break;
            }
        }
		private bool CheckDataInUpdateBounds(NotifyCollectionChangedEventArgs e, PointChartBase chart)
		{
			var dataToPoint = chart.DataSource.DataToPoint;
			if (dataToPoint == null)
				return true;

			if (e.NewItems != null)
			{
				foreach (var dataItem in e.NewItems)
				{
					var point = dataToPoint(dataItem);
					if (increasedVisible.Contains(point))
						return true;
				}
			}
			if (e.OldItems != null)
			{
				foreach (var dataItem in e.OldItems)
				{
					var point = dataToPoint(dataItem);
					if (increasedVisible.Contains(point))
						return true;
				}
			}

			return false;
		}
示例#4
0
        private static void OnItemsPanelTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PointChartBase chart = (PointChartBase)d;

            if (e.NewValue != null)
            {
                chart.OnItemsPanelChanged();
            }
        }
示例#5
0
        private static void OnIndependentValueMappingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PointChartBase owner = (PointChartBase)d;

            string path = (string)e.NewValue;

            if (path == null)
            {
                owner.IndependentValueBinding = null;
            }
            else
            {
                owner.IndependentValueBinding = new Binding(path);
            }
        }
示例#6
0
        private static object CoerceIndependentValuePath(DependencyObject d, object value)
        {
            PointChartBase chart = (PointChartBase)d;

            string path = (string)value;

            if (!String.IsNullOrEmpty(path))
            {
                return(value);
            }

            if (chart.independentValueBinding != null)
            {
                return(chart.independentValueBinding.Path.Path);
            }

            return(null);
        }
示例#7
0
        public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
            case NotifyCollectionChangedAction.Move:
            case NotifyCollectionChangedAction.Remove:
            case NotifyCollectionChangedAction.Replace:
                if (CheckDataInUpdateBounds(e, chart))
                {
                    base.OnUpdate(e, chart);
                }
                break;

            case NotifyCollectionChangedAction.Reset:
                base.OnUpdate(e, chart);
                break;
            }
        }
		public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart)
		{
			switch (e.Action)
			{
				case NotifyCollectionChangedAction.Add:
				case NotifyCollectionChangedAction.Move:
				case NotifyCollectionChangedAction.Remove:
				case NotifyCollectionChangedAction.Replace:
					if (CheckDataInUpdateBounds(e, chart))
					{
						base.OnUpdate(e, chart);
					}
					break;
				case NotifyCollectionChangedAction.Reset:
					base.OnUpdate(e, chart);
					break;
				default:
					break;
			}
		}
		public override void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart)
		{
			switch (e.Action)
			{
				case NotifyCollectionChangedAction.Add:
					chart.OnAdded(e);
					break;
				case NotifyCollectionChangedAction.Move:
					chart.OnMoved(e);
					break;
				case NotifyCollectionChangedAction.Remove:
					chart.OnRemoved(e);
					break;
				case NotifyCollectionChangedAction.Replace:
					chart.OnReplaced(e);
					break;
				case NotifyCollectionChangedAction.Reset:
					chart.OnReset();
					break;
				default:
					break;
			}
		}
示例#10
0
        private static void OnDataSourceReplaced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PointChartBase owner = (PointChartBase)d;

            owner.OnDataSourceReplaced((PointDataSourceBase)e.OldValue, (PointDataSourceBase)e.NewValue);
        }
		public override void OnPlotterDetached(Plotter2D plotter, PointChartBase chart)
		{
			plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;
			this.chart = null;
		}
		public virtual void OnPlotterDetached(Plotter2D plotter, PointChartBase chart) { }
示例#13
0
 public override void OnPlotterDetached(Plotter2D plotter, PointChartBase chart)
 {
     plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;
     this.chart = null;
 }
		public override void OnPlotterAttached(Plotter2D plotter, PointChartBase chart)
		{
			this.chart = chart;
			increasedVisible = plotter.Visible.ZoomOutFromCenter(2.0);
			plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
		}
示例#15
0
 public virtual void OnPlotterAttached(Plotter2D plotter, PointChartBase chart)
 {
 }
示例#16
0
 public abstract void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart);
示例#17
0
 public override void OnPlotterAttached(Plotter2D plotter, PointChartBase chart)
 {
     this.chart       = chart;
     increasedVisible = plotter.Visible.ZoomOutFromCenter(2.0);
     plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
 }
示例#18
0
        private static void OnItemsSourceReplaced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PointChartBase chart = (PointChartBase)d;

            chart.OnItemsSourceReplaced(e);
        }
		public abstract void OnUpdate(NotifyCollectionChangedEventArgs e, PointChartBase chart);