我见过两种图表用法,PlotView
和 Plot
。
如果我使用 PlotView
,我只能使用 Model="{Binding MyModel}"
,我不能像源一样设置其他绑定(bind)。我无法实现 MVVM。
但是如果我使用Plot
,我可以进行任何绑定(bind),xaml 中的许多子控件设置喜欢series
、axes
和等等。
我可以知道有什么不同吗?
最佳答案
两种方法都对,而且都遵循MVVM模式。我认为两者之间的唯一区别是,正如创作者 (Oystein Bjorke) 所说:
The
PlotView
component is now similar on all platforms, it contains onlyModel
andController
properties. ThePlot
control let you define axes, series, annotations etc. and this should only be available in XAML-based platforms.
链接:http://discussion.oxyplot.org/topics/240-cant-define-axes-in-xaml/
作为个人意见,起初我使用了Plot
组件,但后来我遇到了一个问题:如果你想导入绘图,你必须先创建 View 。然后我切换到 PlotView
组件,导入工作正常,没有创建 View 。
关于c# - PlotView 和 Plot 之间有什么不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41604154/