summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38416.xaml.cs
blob: 2a4ee5d8fe00ccac2cd2201699e389a8d0102dc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.ObjectModel;

using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Bugzilla, 38416, "ListView Sized Incorrectly After Containing Layout's Visibility is Toggled")]
    public partial class Bugzilla38416 : TestContentPage
    {
		[Preserve (AllMembers = true)]
	    public class ListItem
	    {
		    public string Name { get; set; }
	    }

#if !UITEST
		void SwapVisibilityClicked(object sender, EventArgs e)
        {
            Box.IsVisible = !Box.IsVisible;
            FirstLayout.IsVisible = !FirstLayout.IsVisible;
            //FirstListView.IsVisible = !FirstListView.IsVisible; //Workaround. Has to be called after the layout's visibility
        }
#endif

		protected override void Init ()
		{
#if !UITEST
			InitializeComponent();

            var items = new ObservableCollection<ListItem>();
            FirstListView.ItemsSource = items;

            for(int i=0; i<70; i++)
            {
                items.Add(new ListItem { Name = string.Format("List Item {0}", i+1) });
            }

            Box.IsVisible = true;
            //FirstListView.IsVisible = false; //Workaround
            FirstLayout.IsVisible = false;
#endif
		}

	}
}