Está en la página 1de 6

Presentación

Nombre: Anthony Josué Peralta (17-EISN-6-003)

Materia: Programación dispositivos Móviles.

Profesor: Frank Fernando Reyes.

Sección: 713 (IS).

Tema: App introducción a Xaml.

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

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
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">

<ContentPage.Content>
<Label Text="Bienvenidos!"
VerticalOptions="Center"
HorizontalTextAlignment="Center"
Rotation="-15"
IsVisible="true"

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

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
FontSize="Large"
FontAttributes="Bold"
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.Compile)]
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.Content>
<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" 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:46:55 GMT -05:00

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
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);
}

}
}

IMAGENES DE LA APP FUNCIONANDO

En la primera imagen esta la pantalla principal de la aplicación luego


de pulsar el botón ingresar este muestra otra página la cual dice
bienvenidos y luego automáticamente lo lleva a la última página que es
la del slide al deslizar el slide va marcando una numeración cuando
este se desliza

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

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:46:55 GMT -05:00

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
This study source was downloaded by 100000842271385 from CourseHero.com on 07-21-2023 17:46:55 GMT -05:00

https://www.coursehero.com/file/116753101/App-introduccion-a-XAMLpdf/
Powered by TCPDF (www.tcpdf.org)

También podría gustarte