Пример #1
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

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

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

            TableView.Source = viewSourceController;
        }
Пример #2
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //TableView.Source = new ViewControllerSource<string>(TableView) {
            //	DataSource = new string[] { "One", "Two", "Three" },
            //};

            var songList = await SongLoader.Load();

            var viewControllerSource = new ViewControllerSource <Song>(TableView)
            {
                DataSource     = songList.ToList(),
                TextProc       = (arg) => arg.Name,
                DetailTextProc = (arg) => $"{arg.Artist} - {arg.Album}"
            };

            TableView.Source = viewControllerSource;
        }
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

//			TableView.Source = new ViewControllerSource<string>(TableView) {
//				DataSource = new string[] { "One", "Two", "Three" },
//			};

            var data = await SongLoader.Load();

            var viewControllerSource = new ViewControllerSource <Song> (this.TableView);

            viewControllerSource.DataSource = data.ToList();

            viewControllerSource.TextProc       = s => s.Name;
            viewControllerSource.DetailTextProc = s => s.Artist + " - " + s.Album;

            this.TableView.Source = viewControllerSource;
        }