public static async Task <SongPage> CreateAsync(SongInfo song) { var instance = new SongPage(); instance.Song = song; instance.Media = App.MediaLoader.LoadMedia(song); instance.Player = await App.PlayerFactory(instance.Media); instance.Player.PositionChanged += instance.Player_PositionChanged; instance.InitializeComponent(); //TODO: Should be set in binding. instance.ScorePicker.SelectedIndex = 0; //TODO: Use themes! NormalButtonBackgroundColor = instance.PlayButton.BackgroundColor; NormalButtonTextColor = instance.PlayButton.TextColor; return(instance); }
private async void LibraryView_ItemTapped(object sender, ItemTappedEventArgs e) { await Navigation.PushModalAsync(await SongPage.CreateAsync(e.Item as SongInfo)); }