Bug 39458 - [UWP/WinRT] Cannot Set CarouselPage.CurrentPage Inside Constructor
Summary: [UWP/WinRT] Cannot Set CarouselPage.CurrentPage Inside Constructor
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.1.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-03-08 18:56 UTC by Jimmy [MSFT]
Modified: 2016-04-22 07:28 UTC (History)
3 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

repro solution (298.30 KB, application/zip)
2016-03-08 18:56 UTC, Jimmy [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jimmy [MSFT] 2016-03-08 18:56:49 UTC
Created attachment 15313 [details]
repro solution

### Overview
On all Windows platforms (UWP/WinRT), setting CarouselPage.CurrentPage in the constructor does not work. It is reset to the first page before the CarouselPage appears.

### Steps to Reproduce
1. Run one of the attached Windows platform projects

### Expected Results
You should see the red “Page 2” after the app launches.

### Actual Results
The blue “page 1” is displayed instead. In the debug output, you can see that CurrentPage was changed, but it is reset to the first page.

Setting CurrentPage anywhere but the constructor seems to work. This is demonstrated by the “Go to Page 2” button on the page working as expected.

### Workaround
You can set CurrentPage in the OnAppearing() instead.

### Version Information
Tested with Forms
Comment 1 Rui Marinho 2016-04-04 11:51:37 UTC
Should be fixed in 2.2-pre1
Comment 2 Rajneesh Kumar 2016-04-22 07:28:16 UTC
I have checked this issue with the XF and observed that this issue has been fixed and working as expected. Now app shows red “Page 2” after the launches.

Screencast: http://www.screencast.com/t/f8iCVIP01ZsK

This issue has been fixed, hence I a m closing this issue.