Example #1
0
 //----------------------------------------------------------------------------------------------------------------------
 protected void OnCurrentListChanged(TrackListViewModel pList)
 {
     //if (pList.CurrentTrack != null)
     //{
     //    int i = pList.Traks.IndexOf(pList.CurrentTrack);
     //    if (i >= 0)
     //        pList.SelectedIndex = i;
     //}
     //Action<TrackListViewModel> handler = CurrentListChanged;
     //if (handler != null)
     //    handler(pList);
 }
Example #2
0
        //----------------------------------------------------------------------------------------------------------------------
        public void NewPlayList()
        {
            string    newListMame = "List" + (TrakLists.Count + 1).ToString();
            TrackList tl          = new TrackList()
            {
                ListName = newListMame
            };
            TrackListViewModel tlv = new TrackListViewModel(tl);

            TrakLists.Add(tlv);
            CurrentList = tlv;
        }
Example #3
0
        //----------------------------------------------------------------------------------------------------------------------
        public MediaDataViewModel(MediaData pData)
        {
            data = pData;
            foreach (var l in Data.TrakLists)
            {
                var tlv = new TrackListViewModel(l);
                TrakLists.Add(tlv);
                tlv.CurrentTrackChanged += () => OnCurrentTrackChanged();
            }
            CurrentList = TrakLists.FirstOrDefault(t => object.ReferenceEquals(Data.CurrentTrackList, t.TrackList));
            if (CurrentList == null && TrakLists.Count > 0)
            {
                CurrentList = TrakLists[0];
            }
//            if (CurrentList == null )
//                OnCurrentListChanged(CurrentList);
            //TrackCollectionViewSource = new CollectionViewSource();
            //if (CurrentList != null)
            //    TrackCollectionViewSource.Source = CurrentList.Traks;
            PropertyChanged             += MediaDataViewModel_PropertyChanged;
            TrakLists.CollectionChanged += TrakLists_CollectionChanged;
        }
Example #4
0
 //----------------------------------------------------------------------------------------------------------------------
 private void MediaDataOnCurrentListChanged(TrackListViewModel pList)
 {
     OnListChangeQuery(pList, pList.SelectedTrack);
 }