小编Jos*_*ose的帖子

PlotView和Plot有什么区别?

我已经看到了两种图表用法,PlotViewPlot

如果使用PlotView,则只能使用Model="{Binding MyModel}",不能设置其他绑定,例如source。我无法实现MVVM。

但是,如果使用Plot,我可以进行任何绑定,并且xaml中的许多子控件设置都可以像seriesaxes等等。

我可以知道有什么不同吗?

c# wpf mvvm oxyplot

5
推荐指数
1
解决办法
1754
查看次数

从子类调用(静态)方法

我创建了一个抽象类,我们称之为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)

.net c# generics

3
推荐指数
1
解决办法
1106
查看次数

标签 统计

c# ×2

.net ×1

generics ×1

mvvm ×1

oxyplot ×1

wpf ×1