oxyplot在设计时抛出错误,命名空间问题

时间:2016-09-12 14:41:01

标签: c# wpf oxyplot

我正在开发一个WPF应用程序,我想在其中集成OxyPlot。 我已经使用相对nuget包将OxyPlot拖入我的项目中。 奇怪的是,Oxy.Core和Oxy.Wpf包只能用作预发行版。

此外,安装后页面被修改为包含在顶部:

OrbitControls

以及托管实际图表的内容:

xmlns:oxy="http://oxyplot.org/wpf"

但是,在设计时,我收到此错误:

  

名称" PlotView"在命名空间中不存在   " http://oxyplot.org/wpf"

知道这里有什么问题吗?

干杯,

吉安

2 个答案:

答案 0 :(得分:1)

控件PlotView曾被称为Plot。因此,取决于您使用其中一个版本的版本。

http://www.oxyplot.org/announcements/plotview

由于您找不到PlotView我认为您有旧版本且需要使用Plot

答案 1 :(得分:0)

在XAML中添加名称空间

<Window
...
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="1*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1*" />
    </Grid.ColumnDefinitions>

    <oxy:PlotView x:Name="plot1"
                  Grid.Row="0"
                  Grid.Column="0"
                  Model="{Binding PlotModelAllSensors}" 
                  BorderBrush="Aqua"/>
</Grid>
</Window>