aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachWaveScroll.cs
blob: aad44bca40f756b3d43780baa891aa2ac17417d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Threading;

namespace RealTimeGraphEx.ReachGraphs
{
    public class RealTimeGraphExReachWaveScroll : RealTimeGraphExReachLineScroll
    {
        public RealTimeGraphExReachWaveScroll()
            : base()
        {

        }

        /// <summary>
        /// Set the cross thread fields.
        /// </summary>
        protected override void OnSetCrossThreadFields()
        {
            base.OnSetCrossThreadFields();

            this.Dispatcher.Invoke(() =>
            {

                _minimum = _maximum * -1;

            }, System.Windows.Threading.DispatcherPriority.Send);
        }

        protected override void OnDrawVisuals()
        {
            double scale = GetPolygonScaleFactor();

            this.Dispatcher.Invoke(() =>
            {
                Polygon.Points = new PointCollection(graphPolygon.ToReachPolygonPointsWaveFill(_width + 1, _height, scale, ConvertYToImageYFliped));
            }, DispatcherPriority.Send);
        }
    }
}