Bug 24977 - ToolbarItems.Insert index has no effect
Summary: ToolbarItems.Insert index has no effect
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: Other Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-02 04:46 UTC by alextj
Modified: 2015-05-20 09:26 UTC (History)
4 users (show)

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

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:
Status:
RESOLVED FIXED

Description alextj 2014-12-02 04:46:14 UTC
WinPhone: Page.ToolbarItems.Insert always inserts toolbar item at the end of the WinPhone application bar, no matter what index is passed as a parameter.

Sample code:
ToolbarItems.Add(item1);
ToolbarItems.Add(item2);
ToolbarItems.Add(item3);
ToolbarItems.Insert(0, item4);

Expected result:
item4 is placed in the beginning (left side) of WinPhone application bar.

Actual result:
item4 is placed at the end (right side) of the WinPhone application bar.

----

In WinPhone native SDK, Insert works as expected:
ApplicationBar.Buttons.Add(item1);
ApplicationBar.Buttons.Add(item2);
ApplicationBar.Buttons.Add(item3);
ApplicationBar.Buttons.Insert(0, item4);

Actual result:
item4 is placed in the beginning (left side) of WinPhone application bar.

----

Built using Visual Studio 2013, Xamarin.Forms 1.2.3. Tested on Windows Phone 8.0.
Both examples are easily reproducible by creating a new Xamarin and/or Windows Phone Silverlight project and inserting the code above.
Comment 1 Rui Marinho 2015-05-20 09:26:03 UTC
This was fixed in the latests versions.