WinRT XAML 工具包可视化错误 [英] WinRT XAML Toolkit Visualization error
本文介绍了WinRT XAML 工具包可视化错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个页面,我想在其中使用 WinRT Xaml 工具包数据可视化控件放置图表.
I have a page where I want to put a chart using WinRT Xaml Toolkit Data Visualization Controls.
我有以下代码:
<Charting:Chart x:Name="PieChart" Width="400" Height="400">
<Charting:Chart.Series>
<Charting:PieSeries IndependentValuePath="X" DependentValuePath="Y"/>
</Charting:Chart.Series>
</Charting:Chart>
VS 告诉我,PieSeries 是错误的:不能将类型为 'PieSeries' 的值添加到类型为 'Collection`1' 的集合或字典中".
VS tells me, PieSeries is wrong: "A value of type 'PieSeries' cannot be added to a collection or dictionary of type 'Collection`1'".
为什么这是一个错误?
推荐答案
它还没有经过全面测试,但现在的示例似乎就是这样,您能做类似的事情吗?
It's not fully tested, but it seems like this is what the sample does right now, could you do something similar?
<charting:Chart
x:Name="PieChart"
Title="Pie Chart"
Margin="70,0">
<charting:Chart.Series>
<Series:PieSeries
Title="Population"
ItemsSource="{Binding Items}"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
</charting:Chart.Series>
</charting:Chart>
这篇关于WinRT XAML 工具包可视化错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文