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

How to navigate from ContentPage to CarouselPage

$
0
0

Hi there,
i just started to code with xamarin. How can I navigate from a ContentPage to a CarouselPage using onClick-event of a button? Here is my Code of this event:

private async void Button_Clicked(object sender, EventArgs e) { await Navigation.PushAsync(new P_Carousel(1)); return; }

and here my Code of "P_Carousel.xaml.cs"

`public P_Carousel (int index)
    {
        InitializeComponent ();

        Children.Add(new ContentPage { Content = new BoxView { Color = new Color(1, 0, 0) }, Title = "Page 1" });
        Children.Add(new ContentPage { Content = new BoxView { Color = new Color(0, 1, 0) }, Title = "Page 2" });
        Children.Add(new ContentPage { Content = new BoxView { Color = new Color(0, 0, 1) }, Title = "Page 3" });


    }`

Viewing all articles
Browse latest Browse all 91519

Trending Articles



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