private void Instance_Connected(object sender, EventArgs e) { InvokeOnMainThread(async() => { await DataService.Instance.InitDataServiceAsHost(); DataService.Instance.Playlist.CollectionChanged += Playlist_CollectionChanged; var source = new SongViewDataSource(DataService.Instance.Playlist); SongsView.SongFocused += SongsView_SongFocused; SongsView.DataSource = source; SongsView.ReloadData(); View.SetNeedsFocusUpdate(); View.UpdateFocusIfNeeded(); PartyCodeLabel.Text = "The code is " + DataService.Instance.PartyCode; }); }
private void Playlist_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { SongsView.ReloadData(); }