示例#1
0
 public static MusicItemViewModel GetInstance()
 {
     if (Instance == null)
     {
         InitLib();
         Instance = new MusicItemViewModel();
     }
     return(Instance);
 }
示例#2
0
        //public MediaPlaybackSession mediaPlayBackSession = new MediaPlaybackSession();

        public NewPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Enabled;
            viewModel = ViewModel.MusicItemViewModel.GetInstance();
            var mediaSource = MediaSource.CreateFromStorageFile(viewModel.SelectedMusicItem.File);

            mediaPlayer.Source = mediaSource;
            mediaSource.OpenOperationCompleted  += MediaSource_OpenOperationCompleted;
            mediaPlayer.CommandManager.IsEnabled = false;
            mediaplayerelement.SetMediaPlayer(mediaPlayer);
            //EllStoryboard.Stop();
            //innerEllStoryboard.Stop();
            Volume_ProcessBar.AddHandler(PointerReleasedEvent, new PointerEventHandler(VolumeButtonPointerReleased), true);
            getLyric(Title.Text, ArtistName.Text);
            UpdatePrimaryTile();
            SelectedMusicItemChanged();
        }