public void Play()
 {
     selectedList = new PlayList(0, null);
     if (selectedModels.Count == 0)
         selectedList = playlist;
     else
     {
         foreach(Composition comp in selectedModels)
         {
             selectedList.AddComposition(comp);
         }
     }
    // ButtonEnabled = false;
     selectedList.IsStop = false;
     NotifyPropertyChanged("ButtonEnabled");
     selectedList.Complete += Stop;
     selectedList.GetProcessLength += Process;
     selectedList.Step += Step;
     selectedList.Reset += Reset;
     thread = new Thread(selectedList.Play);
     thread.IsBackground = true;
     thread.Start();
     PlayCommand = new Command(action => Pause());
     NotifyPropertyChanged("PlayCommand");
     PlayButtonContent = "Pause";
     NotifyPropertyChanged("PlayButtonContent");
 }
 public CompositionLoader(ObservableCollection<Composition> library,ObservableCollection<BaseViewModel> viewModel)
 {
     AddCommand = new Command(action => Add());
     DeleteCommand = new Command(action => Delete());
     AddPlayListCommand = new Command(action => AddPlayList());
     this.library = library;
     this.viewModels = viewModel;
     header = "Library";
 }
 private void Stop(bool stop)
 {
     // ButtonEnabled = true;
     PlayCommand = new Command(action => Play());
     NotifyPropertyChanged("PlayCommand");
     PlayButtonContent = "Play";
     NotifyPropertyChanged("PlayButtonContent");
     thread.Abort();
 }
 public PlayListViewModel(PlayList playList,string name)
 {
     Maximum = 5;
     
     ButtonEnabled = true;
     PlayCommand = new Command(action => Play());
     StopCommand = new Command(action => Stop());
     PlayButtonContent = "Play";
     this.playlist = playList;
     header = name;
 }
 private void Resume()
 {
     selectedList.IsPause = false;
     PlayCommand = new Command(action => Pause());
     NotifyPropertyChanged("PlayCommand");
     PlayButtonContent = "Pause";
     NotifyPropertyChanged("PlayButtonContent");
 }