public PlaylistViewModel(ServiceReference.Playlist pl) { Id = pl.Id; Name = pl.Name; tracks = new BindingList <TrackViewModel>(); loaded = false; }
public static PlaylistTreeItemViewModel FromSPPlaylist(ServiceReference.Playlist playlist, IEnumerable <PlaylistTreeItemViewModel> children = null) { if (playlist.Type == ServiceReference.PlaylistType.Playlist) { return(new Playlist(playlist)); } else { return(new PlaylistFolder(playlist, children)); } }
public PlaylistFolder(ServiceReference.Playlist pl, IEnumerable <PlaylistTreeItemViewModel> children) : base(pl) { if (children == null) { this.children = new BindingList <PlaylistTreeItemViewModel>(); } else { var list = new List <PlaylistTreeItemViewModel>(); foreach (var p in children) { list.Add(p); parent = this; } this.children = new BindingList <PlaylistTreeItemViewModel>(list); } this.children.ListChanged += (s, e) => OnPropertyChanged(() => Children); }
public Playlist(ServiceReference.Playlist pl) : base(pl) { }
public PlaylistTreeItemViewModel(ServiceReference.Playlist pl) : base(pl) { parent = null; }