コード例 #1
0
ファイル: Activity1.cs プロジェクト: rampyodm/XamarinDNR
    protected async override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);

      SetContentView(Resource.Layout.Main);
      SetupAzure();

      var podcastsView = FindViewById<ListView>(Resource.Id.podcastsListView);
      podcastAdapter = new PodcastsAdapter(this);
      podcastsView.Adapter = podcastAdapter;

      podcastsView.ItemClick += (sender, e) =>
      {
        
        var intent = new Intent();
        intent.SetClass(this, typeof(PodcastDetailActivity));
        intent.PutExtra("show_number", (int) e.Id);
        StartActivity(intent);
      };

      // Comment this out if you do not want Twitter Authentication
      // You will need to set your Azure permissions to any client with API Key
      await Authenticate();

      AndHUD.Shared.Show(this, Resources.GetString(Resource.String.loading));
      await ViewModel.ExecuteGetPodcastsCommand();
      podcastAdapter.Podcasts = ViewModel.Podcasts;
      podcastAdapter.NotifyDataSetChanged();
      AndHUD.Shared.Dismiss(this);
    }
コード例 #2
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);
            SetupAzure();

            var podcastsView = FindViewById <ListView>(Resource.Id.podcastsListView);

            podcastAdapter       = new PodcastsAdapter(this);
            podcastsView.Adapter = podcastAdapter;

            podcastsView.ItemClick += (sender, e) =>
            {
                var intent = new Intent();
                intent.SetClass(this, typeof(PodcastDetailActivity));
                intent.PutExtra("show_number", (int)e.Id);
                StartActivity(intent);
            };

            // Comment this out if you do not want Twitter Authentication
            // You will need to set your Azure permissions to any client with API Key
            await Authenticate();

            AndHUD.Shared.Show(this, Resources.GetString(Resource.String.loading));
            await ViewModel.ExecuteGetPodcastsCommand();

            podcastAdapter.Podcasts = ViewModel.Podcasts;
            podcastAdapter.NotifyDataSetChanged();
            AndHUD.Shared.Dismiss(this);
        }