コード例 #1
0
ファイル: PlaylistViewModel.cs プロジェクト: aruns/SpotiFire
 public PlaylistViewModel(ServiceReference.Playlist pl)
 {
     Id     = pl.Id;
     Name   = pl.Name;
     tracks = new BindingList <TrackViewModel>();
     loaded = false;
 }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
            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);
            }
コード例 #4
0
 public Playlist(ServiceReference.Playlist pl)
     : base(pl)
 {
 }
コード例 #5
0
 public PlaylistTreeItemViewModel(ServiceReference.Playlist pl)
     : base(pl)
 {
     parent = null;
 }