using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
namespace Microsoft.Research.DynamicDataDisplay.Charts.Axes
{
///
/// Represents default implementation of label provider for specified type.
///
/// Axis values type.
public class GenericLabelProvider : LabelProviderBase
{
///
/// Initializes a new instance of the class.
///
public GenericLabelProvider() { }
#region ILabelProvider Members
///
/// Creates the labels by given ticks info.
///
/// The ticks info.
///
/// Array of s, which are axis labels for specified axis ticks.
///
public override UIElement[] CreateLabels(ITicksInfo ticksInfo)
{
var ticks = ticksInfo.Ticks;
var info = ticksInfo.Info;
LabelTickInfo tickInfo = new LabelTickInfo();
UIElement[] res = new UIElement[ticks.Length];
for (int i = 0; i < res.Length; i++)
{
tickInfo.Tick = ticks[i];
tickInfo.Info = info;
string text = GetString(tickInfo);
res[i] = new TextBlock
{
Text = text,
ToolTip = ticks[i].ToString()
};
}
return res;
}
#endregion
}
}