Created
April 7, 2015 03:15
-
-
Save angelobelchior/59026c02bb530f2b162d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Xamarin.Forms; | |
namespace MeuDB | |
{ | |
public partial class MyPage : ContentPage | |
{ | |
public MyPage () | |
{ | |
InitializeComponent (); | |
using(var dados = new AcessoDados()) | |
{ | |
this.Lista.ItemsSource = dados.Listar (); | |
} | |
} | |
protected void SalvarClicked(object sender, EventArgs e) | |
{ | |
var contato = new Contato { | |
Nome = this.Nome.Text, | |
Email = this.Email.Text, | |
Telefone = this.Telefone.Text | |
}; | |
using(var dados = new AcessoDados()) | |
{ | |
dados.Insert (contato); | |
this.Lista.ItemsSource = dados.Listar (); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment