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
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); | |
} |
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 System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |
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
// 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" }; | |
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
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 |
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
public class TableViewSource : UITableViewSource | |
{ | |
private List<string> _repositories; | |
public TableViewSource(List<string> repositories) | |
{ | |
_repositories = repositories; | |
} | |
public override int RowsInSection (UITableView tableview, int section) | |
{ |
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
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(); | |
}; |
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
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); |
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
<?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> |
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
<?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> |
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
<?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> |