コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: cyrsis/LearnXamarin
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            //SongLoader.Loader = new StreamLoader();
            //this.DataContext = await SongLoader.Load();

            this.DataContext = await SongLoader.ImprovedLoad();
        }
コード例 #2
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //SongLoader.Loader = new StreamLoader(this);
            //var data = await SongLoader.Load();
            var data = await SongLoader.ImprovedLoad();

            ListAdapter = new ListAdapter <Song>()
            {
                DataSource     = data.ToList(),
                TextProc       = s => s.Name,
                DetailTextProc = s => s.Artist + " - " + s.Album
            };
        }
コード例 #3
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Load the data
            //SongLoader.Loader = new StreamLoader();
            //var data = await SongLoader.Load();
            var data = await SongLoader.ImprovedLoad();

            // Register the TableView's data source
            TableView.Source = new ViewControllerSource <Song>(TableView)
            {
                DataSource     = data.ToList(),
                TextProc       = s => s.Name,
                DetailTextProc = s => s.Artist + " - " + s.Album,
            };
        }