aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisTickData.cs
blob: 08c0ae2fa3cc5d380f4c35b84b39be911ec1d740 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace RealTimeGraphX.WPF
{
    /// <summary>
    /// Represents a graph axis data point tick value wrapper.
    /// </summary>
    public class WpfGraphAxisTickData : DependencyObject
    {
        /// <summary>
        /// Gets or sets a value indicating whether this tick is the first tick.
        /// </summary>
        public bool IsFirst
        {
            get { return (bool)GetValue(IsFirstProperty); }
            set { SetValue(IsFirstProperty, value); }
        }
        public static readonly DependencyProperty IsFirstProperty =
            DependencyProperty.Register("IsFirst", typeof(bool), typeof(WpfGraphAxisTickData), new PropertyMetadata(false));

        /// <summary>
        /// Gets or sets a value indicating whether this tick is the last tick.
        /// </summary>
        public bool IsLast
        {
            get { return (bool)GetValue(IsLastProperty); }
            set { SetValue(IsLastProperty, value); }
        }
        public static readonly DependencyProperty IsLastProperty =
            DependencyProperty.Register("IsLast", typeof(bool), typeof(WpfGraphAxisTickData), new PropertyMetadata(false));

        /// <summary>
        /// Gets or sets a value indicating whether this tick is not the first or last.
        /// </summary>
        public bool IsCenter
        {
            get { return !IsFirst && !IsLast; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this tick index is even.
        /// </summary>
        public bool IsEven
        {
            get { return (bool)GetValue(IsEvenProperty); }
            set { SetValue(IsEvenProperty, value); }
        }
        public static readonly DependencyProperty IsEvenProperty =
            DependencyProperty.Register("IsEven", typeof(bool), typeof(WpfGraphAxisTickData), new PropertyMetadata(false));

        /// <summary>
        /// Gets a value indicating whether this tick index is odd.
        /// </summary>
        public bool IsOdd
        {
            get { return !IsEven; }
        }

        /// <summary>
        /// Gets or sets the actual graph data point.
        /// </summary>
        public IGraphDataPoint Data
        {
            get { return (IGraphDataPoint)GetValue(DataProperty); }
            set { SetValue(DataProperty, value); }
        }
        public static readonly DependencyProperty DataProperty =
            DependencyProperty.Register("Data", typeof(IGraphDataPoint), typeof(WpfGraphAxisTickData), new PropertyMetadata(null));

        /// <summary>
        /// Gets or sets the display text.
        /// </summary>
        public String DisplayText
        {
            get { return (String)GetValue(DisplayTextProperty); }
            set { SetValue(DisplayTextProperty, value); }
        }
        public static readonly DependencyProperty DisplayTextProperty =
            DependencyProperty.Register("DisplayText", typeof(String), typeof(WpfGraphAxisTickData), new PropertyMetadata(null));

        /// <summary>
        /// Gets the <see cref="Data">Data Point</see> value.
        /// </summary>
        public object Value
        {
            get
            {
                return Data != null ? Data.GetValue() : null;
            }
        }
    }
}