-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The LiveChartsCore.SkiaSharpView.Uno.WinUi assemblies should have the LiveChartsCore.SkiaSharpView.WinUI #938
Comments
Here's a workaround: As most of the types cannot be inherited from, the only possible solution is to use conditional exclusions for Uno (starting from Uno 4.8): <Page x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:unolvc="http://uno.ui#using:LiveChartsCore.SkiaSharpView.Uno.WinUI"
xmlns:winlvc="using:LiveChartsCore.SkiaSharpView.WinUI"
mc:Ignorable="d unolvc"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<unolvc:CartesianChart Height="400"
Grid.Column="0"
Grid.Row="0"
Series="{Binding BackTofLeftSeries}"
TooltipPosition="Hidden"
AnimationsSpeed="00:00:00.000" />
<winlvc:CartesianChart Height="400"
Grid.Column="0"
Grid.Row="0"
Series="{Binding BackTofLeftSeries}"
TooltipPosition="Hidden"
AnimationsSpeed="00:00:00.000" />
</Grid>
</Page> and the following exclusion in the corresponding csproj file: <ItemGroup>
<ExcludeXamlNamespaces Include="winlvc" />
<IncludeXamlNamespaces Include="unolvc" />
</ItemGroup> |
@igiona you may also need to include this
I've updated the post above. |
Indeed this helped, thanks! |
@beto-rodriguez Do you have plans on aligning the namespaces? Need help? |
I will take a look into this next week, and let you know, sorry about the late response. |
No worries, as usual, happy to have the team help and answer questions as needed |
After checking this out, it seems that there is a confusion here. The package So there is no need to mix the namespaces and install both packages. The package I also noticed that the LiveCharts docs for Uno are down and this could be causing the confusion (working on that), I keep investigating and trying to make this work with Uno 4.8, currently I am able to make it work every where but on wasm with this error. I will keep this open while the docs are down. |
Thanks for the update! The error you're getting is generally caused by an outdated/misaligned version of SkiaSharp. Which version are you building with? |
oh, I see there is a new version of SkiaSharp, I am on 2.88.2 will try to upgrade to fix that. |
Regarding this, both packages are installed in the same project conditionally (particularly in libraries, which are now present by default in Uno projects) and are generally expected to be be useable from shared source, particularly in XAML from either Uno and WinUI Target Frameworks. In general, when code is shared between WinAppSDK and Uno, it's best to use the same namespaces ( |
@jeromelaban thanks! It works now! WindowsSDK, Wasm and Gtk are working, but on android it seems that the app is not starting: That log is repeating over an over (already waited about 10 mins with no luck). am I missing something? I am trying this at #994, I am not completely sure if I am missing something or this is an issue. |
@beto-rodriguez Thanks for the update. This is quite curious. If you break on all exceptions, do you see anything showing up? |
These are some errors I see in the log:
|
Full output: |
Got it, but does the debugger break on first chance exceptions? @nickrandolph may also know more about this as your sample uses navigation extensions. |
I do not see any break or exception on Visual Studio 17.5.4, the issue should be reproducible using the .sln found here. That solution is the UnoApp template (4.8.9.10) and added the LiveCharts samples there. |
@beto-rodriguez looks like there's an exception when it's trying to load the samples. LiveCharts2/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml.cs Line 36 in d4c084a
You should see the MainPage display. Then when you click on one of the samples you'll see the exception below: [DOTNET] Failed to raise 'PointerPressedEvent': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. |
Thanks @nickrandolph! that helped me to find the issue! It seems that on android the The issue happens here because |
After some research it seems that the SkiaSharp view is not loaded on android (I think all the mobile project). I followed your example here with no luck, notice I am using a newer template of Uno. I created this repository without livecharts that illustrates the issue I am facing. The highlights in that repo is that I am adding a reference SkiaSharp, but as illustrated on your example, on WindowsSDK I referenced Also in this sample I am not using the |
The In the meantime, try using a different namespace name. |
@jeromelaban Thanks for pointing that out! that totally fixed it! sorry and thanks for all your help! |
I will close this issue for now since namespaces are aligned now in the latest NuGet package, and the docs in the website are updated. Thanks to all the Uno team for your help! |
Very nice! Glad we could help, and thanks for working on this, the community will enjoy for sure! |
I confirm it works, many thanks! |
The LiveChartsCore.SkiaSharpView.Uno.WinUI Version 2.0.0-beta.701 assemblies have different namespaces compared to the LiveChartsCore.SkiaSharpView.WinUI Version 2.0.0-beta.701 assmeblies.
This cause issues while compiling cross-platform libraries which need to reference the one or the other package depending on the target (e.g. WASM or Windows).
Expected behavior
The .Uno* assemblies should have the same namespace as their respective non-Uno DLLs.
Additional context
Building a Uno app for WASM and Windows might require to load the packages which target different frameworks.
The text was updated successfully, but these errors were encountered: