summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1267.cs
blob: 2ae722fada5969012b3816fe148a8e63031f66fd (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls
{
	public class PersonCell:ViewCell
	{
		public PersonCell ()
		{
			var grid = new Grid{ 
				RowDefinitions = new RowDefinitionCollection {
					new RowDefinition {Height = new GridLength (1, GridUnitType.Star)},
					new RowDefinition {Height = GridLength.Auto},
				},
				ColumnDefinitions = new ColumnDefinitionCollection {
					new ColumnDefinition {Width = new GridLength (1, GridUnitType.Star)},
					new ColumnDefinition {Width = GridLength.Auto},
				}
			};
			Label label;
			grid.Children.Add (label = new Label {BackgroundColor = Color.Lime});
			label.SetBinding (Label.TextProperty, "FirstName");			

			grid.Children.Add (label = new Label (),0,1);
			label.SetBinding (Label.TextProperty, "LastName");			

#pragma warning disable 618
			grid.Children.Add (label = new Label {XAlign = TextAlignment.End},1,0);
#pragma warning restore 618
			label.SetBinding (Label.TextProperty, "Zip");			

#pragma warning disable 618
			grid.Children.Add (label = new Label {XAlign = TextAlignment.End},1,1);
#pragma warning restore 618
			label.SetBinding (Label.TextProperty, "City");
			View = grid;

			
		}
	}

	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 1267, "Star '*' in Grid layout throws exception", PlatformAffected.WinPhone)]
	public class Issue1267 : ContentPage
	{
		public Issue1267 ()
		{
			var lv = new ListView { 
				ItemsSource = new []{
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
					new {FirstName = "foo", LastName="bar", Zip="1234", City="Gotham City"},
				},
				ItemTemplate = new DataTemplate (typeof(PersonCell)),
			};
			Content = lv;
		}
	}
}