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
{
///
/// Represents a graph axis data point tick value wrapper.
///
public class WpfGraphAxisTickData : DependencyObject
{
///
/// Gets or sets a value indicating whether this tick is the first tick.
///
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));
///
/// Gets or sets a value indicating whether this tick is the last tick.
///
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));
///
/// Gets or sets a value indicating whether this tick is not the first or last.
///
public bool IsCenter
{
get { return !IsFirst && !IsLast; }
}
///
/// Gets or sets a value indicating whether this tick index is even.
///
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));
///
/// Gets a value indicating whether this tick index is odd.
///
public bool IsOdd
{
get { return !IsEven; }
}
///
/// Gets or sets the actual graph data point.
///
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));
///
/// Gets or sets the display text.
///
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));
///
/// Gets the Data Point value.
///
public object Value
{
get
{
return Data != null ? Data.GetValue() : null;
}
}
}
}