public void RefreshData() { try { IsLoadingData = true; // clear all displayed data Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate { Playlists.Clear(); CurrentPlaylistObjects.Clear(); ViewCurrentPlaylistObjects.Refresh(); ViewPlaylists.Refresh(); }); // load the playlists List <VM_Playlist> rawPlaylists = VM_ShokoServer.Instance.ShokoServices.GetAllPlaylists().CastList <VM_Playlist>(); foreach (VM_Playlist contract in rawPlaylists) { Playlists.Add(contract); } IsLoadingData = false; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void RefreshData() { try { IsLoadingData = true; // clear all displayed data System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { Playlists.Clear(); CurrentPlaylistObjects.Clear(); ViewCurrentPlaylistObjects.Refresh(); ViewPlaylists.Refresh(); }); // load the playlists List <JMMServerBinary.Contract_Playlist> rawPlaylists = JMMServerVM.Instance.clientBinaryHTTP.GetAllPlaylists(); foreach (JMMServerBinary.Contract_Playlist contract in rawPlaylists) { PlaylistVM pl = new PlaylistVM(contract); Playlists.Add(pl); } IsLoadingData = false; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }