Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

get error when navigate to a CarouselPage in Android

$
0
0

Hi I have a problem when navigate to CarouselPage in Android.
Below is the my source code in PCL. it works well in iOS, but got System.ArgumentNullException: Argument cannot be null.
please advice.

public class App
    {
        public static Page GetMainPage()
        {
            ContentPage root = new ContentPage();
            StackLayout stack=new StackLayout();            
            root.Content = stack;

            NavigationPage mainPage= new NavigationPage(root);
            stack.Children.Add(
                new Button { Command = new Command(() => { mainPage.Navigation.PushAsync(new CarouselPage()); }), 
                    Text = "Test Nav CarouselPage" }
            );

            return mainPage;
        }
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>