question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xamarin.Forms UWP exception using Pagerenderer

See original GitHub issue

🐛 Bug Report

if i use pagerenderer just like below in uwp, lottie is throwing exception as

  at Lottie.Forms.UWP.Renderers.AnimationViewRenderer.<OnElementChanged>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()

public class ContentPageRenderer : PageRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Page> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null || Element == null)
            {
                return;
            }

            ContentPage page = ((ContentPage)Element);
            if (page.Content == null )
                return;

            var XboxControls = new MyUserControl1();
            StackLayout stackLayout = new StackLayout() { Orientation = StackOrientation.Vertical };
            stackLayout.Children.Add(page.Content);
            stackLayout.Children.Add(XboxControls.ToView());

            page.Content = stackLayout;
        }

    }

Reproduction steps

  1. run attached test project in UWP local, you will see that lottie will throw exception.
  2. remove ContentPagerenderer class and run it again it works.

Version: 1.x 2.7 Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • [x ] 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • [x ] 🐒 Xamarin.Forms

App3.zip

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
azchohficommented, Feb 27, 2019

It has been superseded by a native Microsoft official version. We need to update LottieXamarin to use this new version. https://github.com/windows-toolkit/Lottie-Windows

0reactions
martijn00commented, Apr 24, 2019

@sohchatt @azchohfi i’m happy to take PR’s for the update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin.Forms UWP exception using Pagerenderer #211
Bug Report if i use pagerenderer just like below in uwp, lottie is throwing exception as at Lottie.Forms.UWP.Renderers.
Read more >
Xamarin Forms UWP PageRenderer
There is always a Exception thrown: 'System.InvalidOperationException' in Xamarin.Forms.Platform.UAP.dll error during the build.
Read more >
Customizing a ContentPage - Xamarin
Forms application, in iOS the PageRenderer class is instantiated, ... On the Universal Windows Platform (UWP), the PageRenderer class ...
Read more >
Xamarin.Forms 3.0.0 Service Release 2
To make it easier to support right-to-left languages in Xamarin.Forms, we have ... Github #2633 - "Exception at Xamarin.Forms.Platform.UWP.
Read more >
Xamarin.Forms Basic Document Viewer
It is important that you understand how Xamarin renders the same page on different platforms using ContentPage , ExportRenderer and PageRenderer . In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found