我为线性图表创建了一个自定义工具提示。但是我的问题是这个自定义工具提示永远不会加载..(我仍然得到默认的工具提示,即 X 值)
有什么我应该做的不同的事情吗?
页面.xaml
<Style x:Key="ttip" TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="chartingToolkit:LineDataPoint">
<Grid x:Name="Root" Opacity="0">
<ToolTipService.ToolTip>
<StackPanel>
<ContentControl Content="{TemplateBinding FormattedIndependentValue}"/>
<StackPanel Orientation="Horizontal">
<ContentControl Content="{TemplateBinding FormattedDependentValue}"/>
</StackPanel>
</StackPanel>
</ToolTipService.ToolTip>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<chartingToolkit:Chart x:Name="chart" Grid.Row="0">
<chartingToolkit:LineSeries
DataPointStyle="{StaticResource ttip}" />
page.xaml.cs(创建和绑定)
...
lineSeries = new LineSeries()
{
ItemsSource = storageInfo,
DependentValueBinding = new Binding(dependentValueString),
IndependentValueBinding = new Binding("CollectionDatek__BackingField"),
};
}
...
谢谢你的帮助...
罗恩..