Exception in oxyplot.Avalonia's StyleInclude
Hey,
I'm trying to update my project to Avalonia 11, but I had some problems with the Oxyplot.Avalonia nuget package. On the oxyplot-avalonia main page on github there is an instruction for using oxyplot with Avalonia 11 which I think is wrong, it says AvaloniaEdit in StyleInclude (see screenshot below)
I've read the oxyplot.Avalonia examples and they use the code below to include the style:
StyleInclude Source="avares://OxyPlot.Avalonia/Themes/Default.axaml"/>
But in my project I get the following exception in this code: No precompiled XAML found for avares://OxyPlot.Avalonia/Themes/Default.axaml (baseUri: avares://Nimloth/App.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
I'm using the latest version of the oxyplot.avalonia nuget package, 2.1.0, and Avalonia 11.0.6
I'm on Avalonia 11.07 and also having trouble to get it working. This is a blank project where I only added Oxyplot.Avalonia 2.1.0.
I'm also using
StyleInclude Source="avares://OxyPlot.Avalonia/Themes/Default.axaml"/>
This is the only line I have yet added and the error is:
AVLN:0004 Resource "avares://OxyPlot.Avalonia/Themes/Default.axaml" is defined as "OxyPlot.Avalonia.Themes.Default" type in the "OxyPlot.Avalonia" assembly, but expected "Avalonia.Styling.IStyle". Line 9, position 17. AvaloniaApplication1 9
Any ideas?
Had the same issue, change package reference to 2.1.0-Avalonia11 helps me
dotnet add package Oxyplot.Avalonia --version 2.1.0-Avalonia11
Even with that version and the following code I get exceptions and build errors. How did you resolve it?
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml" />
<!-- Add the line below to get OxyPlot UI theme applied. -->
<StyleInclude Source="resm:OxyPlot.Avalonia.Themes.Default.xaml?assembly=OxyPlot.Avalonia" />
<!-- Add the line below to get OxyPlot UI theme applied in Avalonia 11. -->
<StyleInclude Source="avares://AvaloniaEdit/Themes/Simple/AvaloniaEdit.xaml" />
<SimpleTheme />
</Application.Styles>
Assembly "Avalonia.Themes.Default" was not found from the "avares://Avalonia.Themes.Default/DefaultTheme.xaml" source. Line 8, position 23.