Sei sulla pagina 1di 5

PRACTICA FINAL

Yorbin Díaz 19-SIST-6-022

Pagina Mainpage xaml

<?xml version="1.0" encoding="utf-8" ?>


<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamlSamples.MainPage"
Title="Inicio de Tutorial Xamarin">

<StackLayout>
<!-- Place new controls here -->
<Label Text="Welcome to Xamarin
Forms!" VerticalOptions="Center"
HorizontalOptions="Center" />

</StackLayout>

</ContentPage>

Pagina Mainpage xaml.cs

namespace XamlSamples
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
Button button = new
Button
{
Text = "Ingresar!",
HorizontalOptions =
LayoutOptions.Center, VerticalOptions
= LayoutOptions.Center
}; button.Clicked += async (sender, args) =>
{
await Navigation.PushAsync(new HelloXamlPage());
};
Content = button;

}
}
}

Código página elemento HelloXamlPage.xaml

<?xml version="1.0" encoding="utf-8" ?>


<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamlSamples.HelloXamlPage">
This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:51:37 GMT -05:00

https://www.coursehero.com/file/155270189/PRACTICA-CON-EL-TUTORIAL-INTRODUCCION-A-XAMERINdocx/
<ContentPage.Content>
<Label Text="Bienvenidos!"
VerticalOptions="Center"
HorizontalTextAlignment="Cent
er" Rotation="-15"
IsVisible="true"

FontSize="Large"
FontAttributes="Bol
d"
TextColor="White" /
>

</ContentPage.Content>
</ContentPage>

Código página elemento HelloXamlPage.xaml.cs

using System;
using
System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using
Xamarin.Forms.Xaml;

namespace XamlSamples
{
[XamlCompilation(XamlCompilationOptions.Comp
ile)] public partial class HelloXamlPage :
ContentPage
{
public HelloXamlPage()
{
InitializeComponent();
}
}
}

Código página elemento XAMLPLUSCODEPAGE.XAML

<?xml version="1.0" encoding="utf-8" ?>


<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamlSamples.XamlPlusCodePage"
Title="XAML + Code Page">

<ContentPage.Conten
t>
<StackLayout>
<Label Text="Favor deslizar el slider" Font="Large"
HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
<Slider VerticalOptions="CenterAndExpand"
ValueChanged="Slider_ValueChanged"/>
<Label x:Name="valueLabel" Text="Numeracion del slide"
Font="Large" HorizontalOptions="Center"
This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:51:37 GMT -05:00

https://www.coursehero.com/file/155270189/PRACTICA-CON-EL-TUTORIAL-INTRODUCCION-A-XAMERINdocx/
VerticalOptions="CenterAndExpand" />
<Button Text="Salir" HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" Clicked="Button_Clicked" />
</StackLayout>
</ContentPage.Content>
</ContentPage>

This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:51:37 GMT -05:00

https://www.coursehero.com/file/155270189/PRACTICA-CON-EL-TUTORIAL-INTRODUCCION-A-XAMERINdocx/
Código página elemento XAMLPLUSCODEPAGE.XAML.CS

using System;
using
System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using
Xamarin.Forms.Xaml;

namespace XamlSamples
{
[XamlCompilation(XamlCompilationOptions.Compile)
] public partial class XamlPlusCodePage :
ContentPage
{
public XamlPlusCodePage()
{
InitializeComponent();
}

private void Slider_ValueChanged(object sender, ValueChangedEventArgs e)


{
valueLabel.Text = e.NewValue.ToString("F3");
valueLabel.Text =
((Slider)sender).Value.ToString("F3");
}

private void Button_Clicked(object sender, EventArgs e)


{
System.Environment.Exit(0);
}

This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:51:37 GMT -05:00

https://www.coursehero.com/file/155270189/PRACTICA-CON-EL-TUTORIAL-INTRODUCCION-A-XAMERINdocx/
This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:51:37 GMT -05:00

https://www.coursehero.com/file/155270189/PRACTICA-CON-EL-TUTORIAL-INTRODUCCION-A-XAMERINdocx/
Powered by TCPDF (www.tcpdf.org)

Potrebbero piacerti anche