Reputation: 115
I'm trying to use the OxyPlot.Xamarin.Forms package in my shared Xamarin.Forms project. I added the OxyPlot packages with the NuGet package manager in both the portable and the platform specific (Android) projects like descriped at:
http://docs.oxyplot.org/en/latest/getting-started/hello-xamarin-forms.html
Then I initialized the OxyPlot renderers in the Android project. Now, when I try to start the App the Resource.Designer.cs file is generated, but I get hundreds of errors like so:
Error CS0117 'Resource.Attribute' does not contain a definition for 'mediaRouteSettingsDrawable' OxyPlotShared.Droid \OxyPlotShared\OxyPlotShared.Droid\Resources\Resource.Designer.cs
I use Xamarin.Forms v2.2.0.31 and all OxyPlot packages in version 1.0.0-unstable1983.
Am I missing something?
Upvotes: 3
Views: 733
Reputation: 13188
Note that there are 2 different project templates: Portable and Shared. In your post you mention both of them, so be clear about which one you're using. The specific example you're following is for a Portable project template. After adding the OxyPlot Nuget Package, I had to manually add OxyPlot and OxyPlot.Xamarin.Forms to the References of the Portable one. After that, it worked just fine. I'm using Xamarin.Forms 2.0.0.6482 and OxyPlot 1.0.0-unstable1983.
I added the PlotView
using code:
App.cs:
public App()
{
PlotModel plotModel = new PlotModel { PlotAreaBackground = OxyColors.LightYellow };
plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));
// The root page of your application
MainPage = new ContentPage {
Content = new PlotView {
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill,
Model = plotModel
}
};
}
Upvotes: 1