|
private void legend1_MouseDown(object sender, MouseButtonEventArgs e)
{
trackballBehavior.Hide();
}
. . .
. . .
public class CustomTrackballBehavior : ChartTrackBallBehavior
{
public void Hide()
{
IsActivated = false;
ClearItems();
SetNativeInternalProperty(typeof(ChartTrackBallBehavior), this, string.Empty, "previousXLabel");
SetNativeInternalProperty(typeof(ChartTrackBallBehavior), this, string.Empty, "previousYLabel");
}
internal static void SetNativeInternalProperty(Type type, object obj, object value, string propertyName)
{
var properties = type.GetRuntimeProperties();
foreach (var item in properties)
{
if (item.Name == propertyName)
{
item.SetValue(obj, value);
break;
}
}
}
} |