summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs
blob: 9f596601305ec49317730e416f09cf8ca5557927 (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
namespace Xamarin.Forms.Controls
{
	public partial class NestedNativeControlGalleryPage : ContentPage
	{
		public StackLayout Layout { get; set; }

		public bool NativeControlsAdded { get; set; }

		public NestedNativeControlGalleryPage ()
		{
			Layout = new StackLayout { Padding = 20, VerticalOptions = LayoutOptions.FillAndExpand };

			Content = new ScrollView { Content = Layout };

			var label = new Label { Text = "There should be some native controls right below this", FontSize = 12 };

			var testLabel = new Label { Text = "Forms Label", FontSize = 14 };
			var button = new Button { Text = "Resize Forms Label", HeightRequest = 80	};
			double originalSize = testLabel.FontSize;
			button.Clicked += (sender, args) => { testLabel.FontSize = testLabel.FontSize == originalSize ? 24 : 14; };

			Layout.Children.Add(testLabel); 
			Layout.Children.Add(button); 
			Layout.Children.Add(label); 
		}
	}
}