Пример #1
0
 public void AddAnnotationByAnnotationAndSubDatasetObject(AnnotationInfo annotation, SubDataset subDataset, CurveToShow curveToShow, string uniqueAnnotationName)
 {
     if (string.IsNullOrWhiteSpace(uniqueAnnotationName))
         throw new Exception("Annotation does not have unique name");
     var lineAnnotation = HelperMethods.Instance.GetLineAnnotationByAnnotationInfoAndSubDataset(annotation, subDataset, curveToShow);
     lineAnnotation.Id = uniqueAnnotationName;
     LineAnnotationExtendedBinding(lineAnnotation);
     AddAnnotation(lineAnnotation);
 }
Пример #2
0
 public void AddExistingSubDatasetToTrack(TrackToShow trackToShow, Dataset dataset, CurveToShow curveToShow)
 {
     if (dataset.SubDatasets.Any())
     {
         foreach (var subdataset in dataset.SubDatasets)
         {
             curveToShow.SubDatasets.Add(subdataset);
             foreach (var annotation in subdataset.Annotations)
             {
                 var lineAnnotation = HelperMethods.Instance.GetLineAnnotationByAnnotationInfoAndSubDataset(annotation, subdataset, curveToShow);
                 curveToShow.LineAnnotationExtendedBinding(lineAnnotation);
                 lineAnnotation.Id = annotation.ID;
                 trackToShow.Annotations.Add(lineAnnotation);
             }
         }
     }
 }
Пример #3
0
        private static void BindMarkerProperties(FastLineRenderableSeries fastLineSeries, CurveToShow curveToShow)
        {
            var markerStyleBinding = new MultiBinding
            {
                Converter = new MarkerStyleToPointMarkerConverter()
            };

            markerStyleBinding.Bindings.Add(new Binding("DatasetObject.MarkerStyle")
            {
                Source = curveToShow
            });
            markerStyleBinding.Bindings.Add(new Binding("DatasetObject.MarkerSize")
            {
                Source = curveToShow
            });
            markerStyleBinding.Bindings.Add(new Binding("DatasetObject.ShouldApplyBorderColor")
            {
                Source = curveToShow
            });
            markerStyleBinding.Bindings.Add(new Binding("DatasetObject.MarkerColor")
            {
                Source = curveToShow
            });
            fastLineSeries.SetBinding(FastLineRenderableSeries.PointMarkerProperty, markerStyleBinding);
        }
Пример #4
0
        private void BindCurveProperties(FastLineRenderableSeries fastLineSeries, CurveToShow curveToShow)
        {
            var multiBindingOne = new MultiBinding();
            multiBindingOne.Bindings.Add(new Binding("DatasetObject.LineColor")
                {
                    Source = curveToShow,
                    UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
                });
            multiBindingOne.Bindings.Add(new Binding("DatasetObject.LineStyle")
                 {
                     Source = curveToShow,
                     UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
                 });
            multiBindingOne.Converter = new ColourToMultiColorConverter();
            fastLineSeries.SetBinding(FastLineRenderableSeries.SeriesColorProperty, multiBindingOne);
            fastLineSeries.SetBinding(FastLineRenderableSeries.XAxisIdProperty, new Binding("CurveObject.ID")
            {
                Source = curveToShow
            });

            var multiBinding = new MultiBinding();
            multiBinding.Bindings.Add(new Binding("DatasetObject.LineGrossor")
            {
                Source = curveToShow,
                Mode = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            multiBinding.Bindings.Add(new Binding("DatasetObject.LineStyle")
            {
                Source = curveToShow,
                Mode = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });

            multiBinding.Converter = new LineGrossorToDatasetStrokeThicknessConverter();
            fastLineSeries.SetBinding(FastLineRenderableSeries.StrokeThicknessProperty, multiBinding);

            fastLineSeries.SetBinding(FastLineRenderableSeries.StrokeDashArrayProperty, new Binding("DatasetObject.LineStyle")
            {
                Source = curveToShow,
                Converter = new LineStyleToStrokeDashArrayConverter()
            });

            BindMarkerProperties(fastLineSeries, curveToShow);
        }
Пример #5
0
        public void AddCurveToShowToTrackToShow(TrackToShow trackToShow, Curve curve, IEnumerable<Chart> charts = null)
        {
            var dataset = HelperMethods.Instance.GetDatasetByID(curve.RefDataset);
            if (dataset == null) return;

            if (charts == null)
                AddCurveInformationInDataset(curve, dataset);

            var curveToShow = new CurveToShow(trackToShow.TrackObject.RefChart, trackToShow.TrackObject.ID, dataset.ID)
                {
                    CurveObject = curve,
                    TrackToShowObject = trackToShow,
                    IsSeriesVisible = curve.IsSeriesVisible
                };
            if (charts == null)
                AddExistingSubDatasetToTrack(trackToShow, dataset, curveToShow);

            GlobalDataModel.Instance.StylingOfScaleControl(dataset, curveToShow); 
            
            var xAxis = GetNewXAxisAndSetVisibleRangeLimit(dataset);

            xAxis.Id = curveToShow.CurveObject.ID;
            trackToShow.XAxisCollection.Add(xAxis);

            curveToShow.AnnotationModifier.XAxisId = xAxis.Id;

             var fastLineSeries = GlobalDataModel.Instance.AddDataseriesInformationToCurve(dataset, curveToShow);

            BindCurveProperties(fastLineSeries, curveToShow);

            trackToShow.HasCurves = trackToShow.CurveRenderableSeries.Any();

            IoC.Kernel.Get<IGlobalDataModel>().MainViewModel.CalculateMinMaxVisibleRangeLimitForYAxis();

            trackToShow.Curves.Add(curveToShow);
            curveToShow.IsSeriesVisible = curve.IsSeriesVisible;
        }