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
@angelobelchior
angelobelchior / RemovePluralizingTableNameConvention.cs
Created April 13, 2014 20:42
Removendo a Pluralização das Tabelas no EF
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
@angelobelchior
angelobelchior / operador.cs
Created October 30, 2014 13:32
Reescrita de Operador
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@angelobelchior
angelobelchior / easing.sketch.cs
Created February 16, 2015 21:04
Sketch Xamarin.Forms Easing
// Sketch your next great idea!
using System;
using Xamarin.Forms;
var box = new BoxView(){Color = Color.Blue};
var go = new Button(){ Text = "Go" };
var back = new Button(){ Text = "Clear" };
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
public class TableViewSource : UITableViewSource
{
private List<string> _repositories;
public TableViewSource(List<string> repositories)
{
_repositories = repositories;
}
public override int RowsInSection (UITableView tableview, int section)
{
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 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);
<?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>
<?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"?>
<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>