Esempio n. 1
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //ListAdapter = new ListAdapter<string>() {
            //DataSource = new[] { "One", "Two", "Three" }
            //};

            var data = await SongLoader.Load();

            ListAdapter = new ListAdapter <Song>()
            {
                DataSource     = data.ToList(),
                TextProc       = s => s.Name,
                DetailTextProc = s => s.Artist + " - " + s.Album
            };
        }
Esempio n. 2
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            //ListAdapter = new ListAdapter<string>() {
            //	DataSource = new[] { "One", "Two", "Three" }
            //};

            SongLoader songLoader = new SongLoader(new StreamLoaderDroid());
            var        songList   = await songLoader.Load();

            ListAdapter = new ListAdapter <Song>()
            {
                DataSource     = songList.ToList(),
                TextProc       = song => song.Name,
                DetailTextProc = song => $"{song.Artist} - {song.Album}"
            };
        }
Esempio n. 3
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);


            // inject the dependency
            SongLoader.Loader = new StreamLoader(this);

            // Load Data
            var data = await SongLoader.Load();

            ListAdapter = new ListAdapter <Song>()
            {
                DataSource     = data.ToList(),
                TextProc       = s => s.Name,
                DetailTextProc = s => s.Artist + " - " + s.Album
            };
        }
Esempio n. 4
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            ////ListAdapter = new ListAdapter<string>() {
            ////	DataSource = new[] { "One", "Two", "Three" }
            ////};
            var songs = await SongLoader.Load();

            ListAdapter <Song> adapter = new ListAdapter <Song>()
            {
                DataSource     = songs.ToList(),
                DetailTextProc = (a) => a.Artist + " - " + a.Album,
                TextProc       = (a) => a.Name
            };

            ListAdapter = adapter;
        }
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

//			ListAdapter = new ListAdapter<string>() {
//				DataSource = new[] { "One", "Two", "Three" }
//			};

            var data = await SongLoader.Load();

            var adapter = new ListAdapter <Song> ();

            adapter.DataSource     = data.ToList();
            adapter.TextProc       = s => s.Name;
            adapter.DetailTextProc = s => s.Artist + " - " + s.Album;

            this.ListAdapter = adapter;
        }