Exemplo n.º 1
0
 public MediaFileViewModel()
 {
     mediaFile         = new MediaFile();
     SaveFileCommand   = new SaveFileCommand(this);
     IsMediaOpened     = false;
     PlayMediaCommand  = new PlayMediaCommand(this);
     PauseMediaCommand = new PauseMediaCommand(this);
 }
Exemplo n.º 2
0
 public MediaFileViewModel(MediaFile mediaFile)
 {
     this.mediaFile    = mediaFile;
     SaveFileCommand   = new SaveFileCommand(this);
     IsMediaOpened     = false;
     PlayMediaCommand  = new PlayMediaCommand(this);
     PauseMediaCommand = new PauseMediaCommand(this);
 }
Exemplo n.º 3
0
        /// <summary>
        /// When the Play button is pressed, this is run to play the media.
        /// </summary>
        /// <param name="sender">Where the call comes from.</param>
        /// <param name="e">The information about the click.</param>
        private void btnPlayMedia_Click(object sender, RoutedEventArgs e)
        {
            Button          clickedButton = (Button)sender;
            NBMediaDataItem mediaData     = (NBMediaDataItem)clickedButton.DataContext;

            PlayMediasArgs   args             = new PlayMediasArgs(this, mediaData.MediaSource);
            PlayMediaCommand playMediaCommand = new PlayMediaCommand();

            if (playMediaCommand.CanExecute(args))
            {
                playMediaCommand.Execute(args);
            }
        }