diff options
author | Rui Marinho <me@ruimarinho.net> | 2016-03-30 19:47:06 +0100 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-03-30 19:47:06 +0100 |
commit | 9aa0e924354ef715e3846f59c99f8d24e319e019 (patch) | |
tree | 3e61342d77699bac162df16a6b7cc1f2833f31c5 /Xamarin.Forms.Controls.Issues | |
parent | e3592687559d540ac2238b6ad470abe5a12e8497 (diff) | |
download | xamarin-forms-9aa0e924354ef715e3846f59c99f8d24e319e019.tar.gz xamarin-forms-9aa0e924354ef715e3846f59c99f8d24e319e019.tar.bz2 xamarin-forms-9aa0e924354ef715e3846f59c99f8d24e319e019.zip |
[Controls] Add more info to reproduction of 39359
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39499.cs | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39499.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39499.cs index 44fa2899..1ababbcd 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39499.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39499.cs @@ -13,11 +13,11 @@ using NUnit.Framework; namespace Xamarin.Forms.Controls { - [Preserve (AllMembers = true)] - [Issue (IssueTracker.Bugzilla, 39499, "CarouselViewTest")] + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39499, "CarouselViewTest")] public sealed class CarouselViewContentPage : TestContentPage // or TestMasterDetailPage, etc ... { - [Preserve (AllMembers = true)] + [Preserve(AllMembers = true)] public sealed class Item { static int s_id = 0; @@ -32,30 +32,39 @@ namespace Xamarin.Forms.Controls public int Id => id; } - [Preserve (AllMembers = true)] + [Preserve(AllMembers = true)] public sealed class ItemView : ContentView { - public ItemView () + public ItemView() { - var idLabel = new Label () { StyleId = "id", TextColor = Color.White }; - idLabel.SetBinding (Label.TextProperty, nameof(Item.Id)); + var idLabel = new Label() { StyleId = "id", TextColor = Color.White }; + idLabel.SetBinding(Label.TextProperty, nameof(Item.Id)); - var stackLayout = new StackLayout { + var stackLayout = new StackLayout + { Children = { - new Label { Text = "Target" }, - new Label { Text = "Stack" } + //new Label { Text = "Target" }, + //new Label { Text = "Stack" } }, BackgroundColor = Color.Red }; - var button = CreateButton ("Hide Target Stack", () => { + var button = CreateButton("Hide Target Stack", () => + { stackLayout.IsVisible = false; }); - Content = new StackLayout { + var buttonImage = CreateButton("AddImage", () => + { + stackLayout.IsVisible = true; + stackLayout.Children.Add(new Image { Source = "menuIcon.png" }); + }); + Content = new StackLayout + { Children = { idLabel, button, + buttonImage, stackLayout, } }; @@ -63,23 +72,25 @@ namespace Xamarin.Forms.Controls Button CreateButton(string text, Action clicked) { - var button = new Button (); + var button = new Button(); button.Text = text; - button.Clicked += (s, e) => { - clicked (); + button.Clicked += (s, e) => + { + clicked(); }; return button; } } - static readonly IList<Item> Items = new ObservableCollection<Item> () { + static readonly IList<Item> Items = new ObservableCollection<Item>() { new Item(), new Item(), }; Button CreateButton(string text, Action onClicked = null) { - var button = new Button { + var button = new Button + { Text = text }; @@ -89,18 +100,20 @@ namespace Xamarin.Forms.Controls return button; } - protected override void Init () + protected override void Init() { BackgroundColor = Color.Blue; - var carouselView = new CarouselView { + var carouselView = new CarouselView + { BackgroundColor = Color.Purple, ItemsSource = Items, ItemTemplate = new DataTemplate(typeof(ItemView)), Position = 0 }; - var moveBar = new StackLayout { + var moveBar = new StackLayout + { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { @@ -111,12 +124,13 @@ namespace Xamarin.Forms.Controls } }; - Content = new StackLayout { + Content = new StackLayout + { Children = { carouselView, moveBar, } - }; + } } #if UITEST |