I am trying to play the selected media from PlayList,if the selected index is not zero as below:
if (playList.Items.Count == 0)
   {
      setPlayList();
          if (selectedIndex!= 0)
               { 
                  if(custMediaElement.Playlist!=null)
                  custMediaElement.GoToPlaylistItem(selectedIndex);
               }
    }
But I am getting a Null reference Exc开发者_StackOverflow社区eption while trying to go to PlayList Item with the help of selected index , as explained in top. This works fine if I don't use custMediaElement.GoToPlaylistItem(selectedIndex); but in that case the Media Player Always plays the 1st Item , No matter , Which ever Song I select from the List Box.
Below is few details from Stack Trace:
ExpressionMediaPlayer.MediaPlayer.DoOpenPlaylistItem(PlaylistItem playlistItem)
at ExpressionMediaPlayer.MediaPlayer.GoToPlaylistItem(Int32 playlistItemIndex)
Thanks,
Subhen
After digging through Got the method which worked :
 custMediaElement.GoToPlaylistItemOnNextTick(currentPlayListItem);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论