Skip to content

Instantly share code, notes, and snippets.

View angelobelchior's full-sized avatar
🏠
Working from home

Angelo Belchior angelobelchior

🏠
Working from home
View GitHub Profile
using System;
using SQLite.Net.Interop;
namespace MeuDB
{
public interface IConfig
{
string DiretorioDB { get; }
ISQLitePlatform Plataforma { get; }
}
sing System;
using SQLite.Net.Attributes;
namespace MeuDB
{
public class Contato
{
[PrimaryKey, AutoIncrement]
public int Id {
get;
using System;
using System.Linq;
using Xamarin.Forms;
using System.Collections.Generic;
namespace MeuDB
{
public class AcessoDados : IDisposable
{
private SQLite.Net.SQLiteConnection _conexao;
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:me="clr-namespace:MyNavigarion;assembly=MyNavigarion"
x:Class="MyNavigarion.UITabbedPage">
<TabbedPage.Children>
<ContentPage BackgroundColor="Aqua" Title="Pagina 1" Icon="a.png">
<ContentPage.Content>
<?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="MyNavigarion.UIContentPage">
<ContentPage.Content>
<StackLayout Spacing="20" Padding="20">
<Entry Placeholder="Teste"></Entry>
<Button Text="Salvar" Clicked="OnClicked"></Button>
</StackLayout>
</ContentPage.Content>
<?xml version="1.0" encoding="UTF-8"?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:me="clr-namespace:MyNavigarion;assembly=MyNavigarion"
x:Class="MyNavigarion.UICarouselPage">
<CarouselPage.Children>
<ContentPage BackgroundColor="Aqua" Title="Pagina 1">
<ContentPage.Content>
<Label Text="Pagina 1" TextColor="White"></Label>
</ContentPage.Content>
public class GitHubApi
{
public async Task<List<string>> GetAsync(string user)
{
string url = string.Format("https://api.github.com/users/{0}/repos", user);
var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", "Other");
var response = await client.GetAsync(url);
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
btnSearch.TouchUpInside += async (object sender, EventArgs e) => {
var github = new Shared.GitHubApi();
var repositories = await github.GetAsync(txtUser.Text);
lvwRepositories.Source = new TableViewSource(repositories);
lvwRepositories.ReloadData();
};
public class TableViewSource : UITableViewSource
{
private List<string> _repositories;
public TableViewSource(List<string> repositories)
{
_repositories = repositories;
}
public override int RowsInSection (UITableView tableview, int section)
{
namespace MyApp
{
[Activity (Label = "MyApp", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource