我已经看到了两种图表用法,PlotView和Plot。
如果使用PlotView,则只能使用Model="{Binding MyModel}",不能设置其他绑定,例如source。我无法实现MVVM。
但是,如果使用Plot,我可以进行任何绑定,并且xaml中的许多子控件设置都可以像series,axes等等。
我可以知道有什么不同吗?
我创建了一个抽象类,我们称之为FooBarizable,它是 2 个类的父类(更多在实践中),Foo并且Bar. 现在,我有一个可以根据他的类型FooBarizableManager进行管理Foo和上课的人。Bar由此FroobarizableManager,我想打电话getFooBarizables()。我们看一下结构:
FooBarized.cs:
public abstract class FooBarizable{
public string Name { get; set; }
public static IEnumerable<FooBarizable> GetFooBars(){
throw new NotImplementedException();
}
}
Run Code Online (Sandbox Code Playgroud)
Foo.cs:
public class Foo : FooBarizable{
public static IEnumerable<FooBarizable> GetFooBars(){
return API.getFoos();
}
}
Run Code Online (Sandbox Code Playgroud)
酒吧.cs:
public class Bar : FooBarizable{
public static IEnumerable<FooBarizable> GetFooBars(){
return API.getBars();
}
}
Run Code Online (Sandbox Code Playgroud)
FooBarizedManager.cs:
public class FooBarizableManager {
private Type type;
public FooBarizableManager(Type _t){ …Run Code Online (Sandbox Code Playgroud)