private void Tweets_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Tweets.SelectedItem == null)
            {
                return;
            }

            viewModel.Speak(Tweets.SelectedIndex);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var search   = FindViewById <EditText>(Resource.Id.search_text);
            var button   = FindViewById <Button>(Resource.Id.get_tweets);
            var listView = FindViewById <ListView>(Resource.Id.listView);
            var progress = FindViewById <ProgressBar>(Resource.Id.progressBar);

            progress.Indeterminate = true;
            progress.Visibility    = ViewStates.Invisible;


            button.Click += async(sender, args) =>
            {
                button.Enabled = false;

                progress.Visibility = ViewStates.Visible;

                await viewModel.LoadTweetsCommand(search.Text.Trim());


                listView.Adapter = new TweetAdapter(this, viewModel);

                progress.Visibility = ViewStates.Invisible;
                button.Enabled      = true;
            };

            listView.ItemClick += (sender, args) =>
            {
                viewModel.Speak(args.Position);
            };
        }
Esempio n. 3
0
 public void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     viewModel.Speak(indexPath.Row);
 }