Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SistemaEscolar: PaginaListaEscuelas.xaml.cs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using SistemaEscolar.Modelos;
using SistemaEscolar.Servicios;
namespace SistemaEscolar.Paginas
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class PaginaListaEscuelas : ContentPage
{
public PaginaListaEscuelas ()
{
InitializeComponent ();
}
protected async override void OnAppearing()
{
base.OnAppearing();
Loading(true);
var bd = new ServicioBaseDatos<Escuela>();
lsvEscuelas.ItemsSource = await bd.ObtenerTabla();
Loading(false);
}
void Loading(bool mostrar)
{
indicator.IsEnabled = mostrar;
indicator.IsRunning = mostrar;
}
private async void lsvEscuelas_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
try
{
var dato = (Escuela)e.SelectedItem;
await Navigation.PushAsync(new PaginaEscuela(dato));
lsvEscuelas.SelectedItem = null;
}
catch (Exception ex)
{
}
}
public async void btnAgregar_Clicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new PaginaEscuela(new Escuela()));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.