summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs66
1 files changed, 66 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs
new file mode 100644
index 00000000..31d4345c
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1777.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls.TestCasesPages
+{
+ [Preserve (AllMembers=true)]
+ [Issue (IssueTracker.Github, 1777, "Adding picker items when picker is in a ViewCell breaks", PlatformAffected.WinPhone)]
+ public class Issue1777 : ContentPage
+ {
+ Picker _pickerTable = null;
+ Picker _pickerNormal = null;
+
+ public Issue1777 ()
+ {
+ StackLayout stackLayout = new StackLayout();
+ Content = stackLayout;
+
+ TableView tableView = new TableView();
+ stackLayout.Children.Add( tableView);
+
+ TableRoot tableRoot = new TableRoot();
+ tableView.Root = tableRoot;
+
+ TableSection tableSection = new TableSection("Table");
+ tableRoot.Add(tableSection);
+
+ ViewCell viewCell = new ViewCell ();
+ tableSection.Add (viewCell);
+
+ ContentView contentView = new ContentView ();
+ contentView.HorizontalOptions = LayoutOptions.FillAndExpand;
+ viewCell.View = contentView;
+
+ _pickerTable = new Picker ();
+ _pickerTable.HorizontalOptions = LayoutOptions.FillAndExpand;
+ contentView.Content = _pickerTable;
+
+ Label label = new Label ();
+ label.Text = "Normal";
+ stackLayout.Children.Add (label);
+
+ _pickerNormal = new Picker ();
+ stackLayout.Children.Add (_pickerNormal);
+
+ Button button = new Button ();
+ button.Clicked += button_Clicked;
+ button.Text = "do magic";
+ stackLayout.Children.Add (button);
+
+ //button_Clicked(button, EventArgs.Empty);
+ _pickerTable.SelectedIndex = 0;
+ _pickerNormal.SelectedIndex = 0;
+ }
+
+ void button_Clicked (object sender, EventArgs e)
+ {
+ _pickerTable.Items.Add ("test " + _pickerTable.Items.Count);
+ _pickerNormal.Items.Add ("test " + _pickerNormal.Items.Count);
+ }
+ }
+}