public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary, SavedPlayerState playerState) : this(savedState, multiScreen, dataLibrary)
 {
     if (playerState == null)
     {
         throw new ArgumentNullException("PlayerState");
     }
     if (playerState.FileList == null)
     {
         throw new ArgumentNullException("files");
     }
     if (playerState.File == null)
     {
         throw new ArgumentNullException("file");
     }
     this.ContentType = playerState.ContentType;
     if (playerState.ContentType != MediaLibrary.DataModels.ContentType.Track)
     {
         this.files = new FileList(playerState.FileList);
     }
     else
     {
         this.files = new TrackList(playerState.FileList);
     }
     this.SelectedFile      = playerState.File;
     this.DefaultPosition   = new double?(playerState.Position);
     this.MediaElementState = playerState.MediaElementState;
     this.IsRepeat          = playerState.IsRepeat;
     this.IsRandom          = playerState.IsRandom;
 }
Пример #2
0
 public override async Task OnNavigateToAsync()
 {
     //await this.<>n__FabricatedMethod2();
     if (this.dataLibrary != null)
     {
         this.multimediaLoadingPopup  = base.Controller.CreatePopup(new MultimediaAddingContentPopupViewModel(this.dataLibrary), false);
         this.dataLibrary.DataLoaded += new EventHandler(this.OnDataLoadedChanged);
     }
     if (!this.isPlayerResumed && this.savedVisualState != null && this.savedVisualState.PlayerState != null)
     {
         BaseSavedVisualState baseSavedVisualState = this.SaveVisualState(this.savedVisualState.PlayerState);
         base.Controller.Navigate(new MediaPlayerViewModel(baseSavedVisualState, this.multiScreen, this.dataLibrary, baseSavedVisualState.PlayerState), false);
         this.isPlayerResumed = true;
     }
 }
 public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary)
 {
     if (savedState == null)
     {
         throw new ArgumentNullException("savedmusicstate");
     }
     if (multiScreen == null)
     {
         throw new ArgumentNullException("multiScreen");
     }
     if (dataLibrary == null)
     {
         throw new ArgumentNullException("dataLibrary");
     }
     this.savedViewVisualState = savedState;
     this.multiScreen          = multiScreen;
     this.dataLibrary          = dataLibrary;
     this.InitializeCommands();
 }
 public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary, IEnumerable <ItemBase> files, Content selectedFile, MediaLibrary.DataModels.ContentType contentType) : this(savedState, multiScreen, dataLibrary)
 {
     if (files == null)
     {
         throw new ArgumentNullException("files");
     }
     this.ContentType = contentType;
     this.Position    = 0;
     if (contentType != MediaLibrary.DataModels.ContentType.Track)
     {
         this.files = new FileList(files);
     }
     else
     {
         this.files = new TrackList(files);
     }
     if (selectedFile != null)
     {
         this.SelectedFile = selectedFile;
         return;
     }
     this.SelectedFile = files.FirstOrDefault <ItemBase>();
 }