This document contains the code for a Xamarin.Forms login page. It includes an image, label, entry field for a name, and a login button laid out in a stack layout. When the login button is clicked, it will trigger the LoginButton_Clicked method.
1 of 24
More Related Content
掛温馨温姻庄稼を乾り兵めた矧の三?乾りたい繁に鬚韻?
10. <?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="App1.Views.XamlPage"
...
Title="Login Page">
<StackLayout Padding="8" Spacing="4">
<Image Source="/Images/Xamagon.png"
HeightRequest="300"
WidthRequest="300" />
<Label FontSize="Large"
Text="Xamarin.Forms Login Page" />
<Entry x:Name="entry"
Text="{Binding Name}" />
<Button x:Name="loginButton"
Clicked="LoginButton_Clicked"
Text="Login" />
</StackLayout>
</ContentPage>
public class CSharpPage : ContentPage
{
public CSharpPage()
{
var image = new Image { ... };
var label = new Label {... };
var entry = new Entry { ... };
var loginButton = new Button {... };
loginButton.Clicked += LoginButton_Clicked;
Title = "Login Page";
Content = new StackLayout
{
Children =
{
image,
label,
entry,
loginButton
},
};
}
}