使用Silverlight Toolkit绘制图表(下)--饼图,折线图,散点图
2009-02-16 11:57:09 来源:WEB开发网<controls:DockPanelLastChildFill="False"controls:DockPanel.Dock="Right">
<StackPanel x:Name="InformationPanel"controls:DockPanel.Dock="Top"Margin="5">
<TextBlockText="SelectedCityDetails"FontWeight="Bold"/>
<StackPanelOrientation="Horizontal">
<TextBlockText="Name:"/>
<TextBlockText="{BindingName}"/>
</StackPanel>
<StackPanelOrientation="Horizontal">
<TextBlockText="Population:"/>
<TextBlockText="{BindingPopulation}"/>
</StackPanel>
</StackPanel>
<Button Content="取消选中"Click="Unselect_Click"Margin="5"controls:DockPanel.Dock="Bottom"/>
</controls:DockPanel>
这里,我们只要在PieSample.Xaml.cs文件中编写事件BarSeries_SelectionChanged处理代码即可:
privatevoidBarSeries_SelectionChanged(objectsender,SelectionChangedEventArgse)
{
InformationPanel.DataContext=(1<=e.AddedItems.Count)?e.AddedItems[0]:null;
}
privatevoidUnselect_Click(objectsender,System.Windows.RoutedEventArgse)
{
(FunctionSeriesSample.Series[0]asPieSeries).SelectedItem=null;
}
Tags:使用 Silverlight Toolkit
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接