CarouselPage current page

Hi,
I am using Carousel page with two content pages as a children. After loading and done with binding on click of any item of ListView i want my second content page to slide and come in focus. I tried few things but it doesn't seems to be working so please help to achieve this.

Posts

  • PradeepVishwakarmaPradeepVishwakarma INMember ✭✭
    edited October 2014

    Hi,
    After lots of research and trying many things i achieve this by doing few steps that i would like to share to help if any one facing the same what i did was OnItemSelected event i put this.BatchBegin(); and then logic to get current tapped item and then changing current page by this.CurrentPage = this.Children[1]; and at the end i used this.BatchCommit(); and its working fine now.

    public void OnItemSelected(object sender, ItemTappedEventArgs e)
    {
    try
    {
    this.BatchBegin();
    var mealCategory = e.Item as YourModel;
    if (mealCategory == null)
    return;

                var htmlSource = new HtmlWebViewSource { Html = MealsViewModel.GetMealsDetail(mealCategory) };
                webViewMealsDetail.Source = htmlSource;
                this.CurrentPage = this.Children[1];
                this.BatchCommit();
            }
            catch (Exception ex)
            {
    
            }
        }     
    
  • madziemadzie Member ✭✭

    Thank you so much @PradeepVishwakarma . I was looking for exact same thing and there was no direct answer yet.

Sign In or Register to comment.