public PlayControlViewModel(Dispatcher dispatcher, SMPSettings settings, PlaylistsViewModel playlistsViewModel, MedialibViewModel medialibViewModel) { this.playlistsViewModel = playlistsViewModel; this.medialibViewModel = medialibViewModel; this.SMPSettings = settings; this.PlayerEngine.PlayNextFileAction = () => { if (this.SMPSettings.PlayerSettings.RepeatMode) { if (this.CanPlayOrPause()) { var file = this.playlistsViewModel.GetCurrentPlayListFile(); if (file != null) { this.PlayerEngine.Play(file); } } } else { if (this.CanPlayNext()) { this.PlayNext(); } } }; }