public ViewModel() { Clicked = new Command(async o => { var github = new GitHubApiAppCore.GitHubApi(); Items = await github.GetAsync(User); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. btnSearch.TouchUpInside += async(object sender, EventArgs e) => { var github = new GitHubApiAppCore.GitHubApi(); var repositories = await github.GetAsync(txtUser.Text); lvwRepositories.Source = new TableViewSource(repositories); lvwRepositories.ReloadData(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var txtUser = FindViewById <EditText>(Resource.Id.txtUser); var btnSearch = FindViewById <Button>(Resource.Id.btnSearch); var lvwRepositories = FindViewById <ListView>(Resource.Id.lvwRepositories); btnSearch.Click += async(object sender, System.EventArgs e) => { var github = new GitHubApiAppCore.GitHubApi(); var repositories = await github.GetAsync(txtUser.Text); lvwRepositories.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItemSingleChoice, repositories); }; }