当我编译程序时,它没有错误,但是当我尝试运行时,VS2015在XAML中抛出异常:
无法加载文件或程序集'OxyPlot.Wpf,Version = 2011.3.4094.38387,Culture = neutral,PublicKeyToken = 75e952ba404cdbb0'或其依赖项之一。定义集的定位与程序集引用不匹配。 (HRESULT异常:0x80131040)
(我正在使用谷歌翻译,因为我已经使用了波兰语操作系统,因此VS会使用该语言进行翻译)
我不确定问题出在哪里, 这是xaml代码:
<StackPanel Grid.Column="1" Grid.Row="1" Margin="0,5,0,0">
<oxy:PlotView Height="50" Margin="2" Model="{Binding AmplitudeSquareModel}"/>
</StackPanel>
和* .cs文件:
public PlotModel AmplitudeSquareModel { get; private set; }
private double AmplitudeSquare(double _amp, int time)
{
double res = 0;
double time_d = time;
for (int j = 1; j < 100; ++j)
{
if (j % 2 == 1)
res += (Math.Sin(j * (time_d / 10)) / j);
}
res *= (4 * _amp) / Math.PI;
return res;
}
public void Draw(int HowManyIteration)
{
List<double> square = new List<double>();
this.AmplitudeSquareModel = new PlotModel { Title = "Square" };
for (int i = 0; i < HowManyIteration; ++i)
{
Func<double, double> SquareFun = (x) => AmplitudeSquare(4, i);
AmplitudeSquareModel.Series.Add(new FunctionSeries(SquareFun, 0, 100, 0.1, "square"));
}
}
我真的不知道问题出在哪里......