-
Notifications
You must be signed in to change notification settings - Fork 59
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
Plot doesn't display until Window resize on Xamarin.Forms UWP #34
Comments
I have updated the Xamarin.Forms/SimpleDemo example for UWP, and see the same error there. |
@objorke okay I've been able to pin this bug down to a single point. It's actually in the Oxyplot.Windows project in the implementation of Windows.UI.Xaml.Controls.Control class for PlotView. More specifically, it is in the method override for ArrangedOverride(Size finalSize). The bug being that in a Xamarin Forms UWP project UpdateVisuals() is not being called until the Window is resized; whereas, in a Windows (non-Xamarin.Forms project) it is being called without the Window needing resized. https://github.com/oxyplot/oxyplot/blob/master/Source/OxyPlot.Windows/PlotView.cs#L799 |
From PR: I thinking one of the main problems is that the size parameter is only provided to the protected override Size ArrangeOverride(Size finalSize) method once, and in all my debugging it's only been 0 for both x and y thus causing UpdateVisuals() to not be called. |
@objorke It seems that in the Windows PlotView, when being invoked by the Xamarin.Forms Renderer, |
This should be solved in OxyPlot.Xamarin.Forms.1.1.0-unstable0011 (nuget.org) |
@clarkis117 can we close this issue? |
@clarkis117 I personally haven't had trouble with pie charts showing up in debug mode upon loading, resizing or not...but I've tried to build my UWP app in release mode and unfortunately I'm still not getting it to show up although it shows the pie chart just fine in debug (with 1.1.0-unstable0011 too)...if anyone was able to build it in release and then show up could you share any runtime directives you used...maybe if you copy those to the library rd.xml it may start working in other people's apps in release too...I've recently been able to solve one UWP app's problem following some advice here (but that app used the AutoMapper/LINQ reflection/serialization) @objorke I may have spoke too soon...turns out, for me at least, charts showing up, without having to resize anything, was, in fact, just a fluke...because I used Microsoft.NETCore.UniversalWindowsPlatform-prerelease...if you use stable 5.2.0, even in debug it won't show, until you actually resize the window first (so I'd guess that with prerelease in debug this resizing issue is solved for having to resize, but in release and thus being able to publish to Store, it's still problem on even if you use the aforementioned latest prerelease nuget - 5.3.0-beta2) which is a 100% sure sign the .NET Native compiler is to blame and the only way to currently fix it without waiting for another of their versions is to use runtime directives they recommend in the ".NET Native deep dive" blog article series (mentioned in the above issue from fixing AutoMapper). |
sorry, I can´t contribute on this issue at the moment! |
Credits here go to @MattWhilden
And then .NET Native just ends up throwing FileNotFound because clrcompression is not a .NET library (it’s a native library). As @MattWhilden pointed out Xamarin guards against other Load failures but not that one. And there's a chance they just might fix it soon. Keep fingers crossed...I like OxyPlot, I get Skia's theirs, but why not have both :) Hope to hear something soon. |
For those keeping track at home, and like to connect all the dots, there's a very similar looking issue on the Xamarin.Forms Bugzilla: https://bugzilla.xamarin.com/show_bug.cgi?id=52482 I'm working on tracking down some Xamarin folks internally, I'll try to keep y'all updated but definitely feel free to ping me if you think I've disappeared for too long. I don't mind. :-) |
Oh man, this seems like it might be a workaround: https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/#troubleshooting |
But how do you use a workaround on this project...since clrcompression is not a .NET assembly and you don't know from the error which usually follows with missing metadata output for which class in what assembly is being used (so I feel it's to no avail to try this workaround on this particular project for some reason except by trying to guess the classes:)...I've used the workaround though on some other projects that I created but which mostly used some Xamarin.Forms control classes and such things? |
Because I've just tried about all an every class I could think of for OxyPlot to find in which assembly if fails...since we're loading an
but I still get the same exception, maybe it's just me :( |
Nevermind, call me blind, I've missed one class somehow:
Adding all of the above (including OxyPlot.Windows.PlotView beside the OxyPlot.Xamarin.Forms.PlotView) to the assemblies to include shows the SimpleDemo chart in Release for me now (I'm sorry for being a dumbass and thanks again @MattWhilden)...now I'll try and add UWP to my project using some other plot types (although I suspect these five or even three should of been enough - OxyPlot.Core, OxyPlot.Windows and OxyPLot.Xamarin.Forms dlls). |
Fantastic news! I am very happy to hear you are unblocked. Patterns that cause looser coupling in your program (ex: dependency injection) are great for flexibility but definitely cause us headaches when we're trying to make various engineering trade offs. This is a great example: if we roll all of your code into one big native binary we see decent startup and working set wins that benefit everyone. However, we also break anyone who assumed (completely innocently) that we'd never have a good reason to radically re-layout your code on disk. We have an open issue on our side to try and hide this particular "irregularity" of .NET Native and I've added this as another instance of it causing issues for folks. If you see anything else out of place (or just want to send some feedback!), please reach out to us again. We are happy to help |
using the latest OxyPlot.Xamarin.Forms.1.1.0-unstable0011 (nuget.org) when using (Microsoft Practices Unity) In Debug Mode (NOT in Release Mode):
To get it works in Release Mode. The following extra codes are necessary:
|
A possible bug with the Oxyplot for Windows UWP , PlotView interacting with the Xamarin.Forms View Renderer. The plot doesn't display until after the window resizes. After the window resizes the UWP canvas draws the plot.
The text was updated successfully, but these errors were encountered: