[英]Missing Assembly - using OxyPlot in WPF
我正在WPF中使用OxyPlot。 尝试命名我的plotview我遇到编译器错误:
编译器错误消息:CS0234:类型或名称空间名称'Wpf'在名称空间'NameOfProject'中不存在(您是否缺少程序集引用?)
我的XAML代码非常简单:
<Window x:Class="NameOfProject"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
Title="Plot_MV" Height="auto" Width="auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<Button
Grid.Row="0"
Margin="10,10,0,10"
Content="ExportToPDF"
Height="30"
Width="80"
HorizontalAlignment="Left" Click="Button_Click">
</Button>
<oxy:PlotView
x:Name="plotName"
Model="{Binding plotModel}"
Grid.Row="1">
</oxy:PlotView>
</Grid>
</Window>
我正在使用XS Express 2012和OxyPlot版本2015.1.1046.0,有人想解决它吗?
假设您有自己的课程: MyWindow
:
namespace MyProject {
public class MyWindow : Window
{
// code here
}
}
然后在XAML
需要对类进行限定(使用名称空间)
<Window x:Class="MyProject.MyWindow" ...
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.