Download presentation
Presentation is loading. Please wait.
1
Xamarin Forms Lecture 2 Greetings Demos
3
App.cs
9
using System; using Xamarin.Forms; namespace Greetings { public class GreetingsPage : ContentPage Label label3 = new Label(); public GreetingsPage() Label label1 = new Label Text = "Hello There", FontSize = 30, FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center }; Label label2 = new Label Text = "CSC 425 Rocks!", label3.Text = ""; label3.FontSize = 20; label3.HorizontalOptions = LayoutOptions.Center; Button button = new Button Text = "Sherlock", BorderWidth = 1, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand button.Clicked += OnButtonClicked; this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5); this.Content = new StackLayout { Children = label1, label2, label3, button } }; void OnButtonClicked(object sender, EventArgs e) if (label3.Text == "") label3.Text = "Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table. I stood upon the hearth-rug and picked up the stick which our visitor had left behind hm the night before. It was a fine, thick piece of wood, bulbous-headed, of the sort which is known as a \u201CPenang Lawyer.\u201D Just under the head was a broad silver band, nearly an inch across, \u201CTo James Mortimer, M.R.C.S, from his friends of the C.C.H.,\u201D was engraved upon it, with the date \u201C1884.\u201D It was just such a stick as the old-fashioned family practitioner used to carry\u2014dignified, solid, and reassuring."; else label3.Text = "";
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.