示例#1
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            YouTubeSearcher searcher = new YouTubeSearcher();

            SearchResult = searcher.Search(this.txtKeyword.Text);
            this.VideoList.ItemsSource = SearchResult;
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            var tvSearch  = FindViewById <TextView> (Resource.Id.editText1);
            var btnSearch = FindViewById <Button> (Resource.Id.button1);

            listview = FindViewById <ListView>(Resource.Id.listViewMain);

            btnSearch.Click += (sender, e) => {
                var searcher = new YouTubeSearcher();
                entrys = searcher.Search(tvSearch.Text);
                foreach (Entry en in entrys)
                {
                    en.pic = GetImageBitmapFromUrl(en.Thumbnail);
                }
                listview.Adapter    = new EntryAdapter(this, entrys);
                listview.ItemClick += (senderobj, e2) => {
                    var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(entrys[e2.Position].Link));
                    StartActivity(intent);
                };
            };
        }
示例#3
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     this.BtnSearch.SearchButtonClicked += (obj, e) =>
     {
         YouTubeSearcher searcher = new YouTubeSearcher();
         SearchResult          = searcher.Search(this.BtnSearch.Text);
         this.TblResult.Source = new DataSource(this, SearchResult);
         this.TblResult.ReloadData();
         this.BtnSearch.ResignFirstResponder();
     };
 }
示例#4
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     this.BtnSearch.SearchButtonClicked += (obj, e) =>
     {
         YouTubeSearcher searcher = new YouTubeSearcher();
         SearchResult = searcher.Search(this.BtnSearch.Text);
         this.TblResult.Source = new DataSource(this, SearchResult);
         this.TblResult.ReloadData();
         this.BtnSearch.ResignFirstResponder();
     };
 }
示例#5
0
 private void btnSearch_Click(object sender, RoutedEventArgs e)
 {
     YouTubeSearcher searcher = new YouTubeSearcher();
     SearchResult = searcher.Search(this.txtKeyword.Text);
     this.VideoList.ItemsSource = SearchResult;
 }