void vpaid_AdError(object sender, VpaidMessageEventArgs e)
 {
     state = vPaidState.Failure;
     NotifyIsPlayResumeEnabledChanged();
     NotifyIsPauseEnabledChanged();
     OnCurrentStateChanged(new RoutedEventArgs());
 }
 void vpaid_AdStarted(object sender, object e)
 {
     state = vPaidState.Playing;
     NotifyIsPlayResumeEnabledChanged();
     NotifyIsPauseEnabledChanged();
     OnCurrentStateChanged(new RoutedEventArgs());
 }
 void vpaid_AdLoaded(object sender, object e)
 {
     state = vPaidState.Loaded;
     OnPropertyChanged(() => Duration);
     OnPropertyChanged(() => TimeRemaining);
     OnPropertyChanged(() => SignalStrength);
     OnPropertyChanged(() => MediaQuality);
     OnCurrentStateChanged(new RoutedEventArgs());
     estimatedDuration = Vpaid.AdRemainingTime;  // used to estimate the duration of the ad for vpaid 1.1
 }
        void vpaid_AdStopped(object sender, object e)
        {
            state = vPaidState.Completed;
            NotifyIsPlayResumeEnabledChanged();
            NotifyIsPauseEnabledChanged();
            OnCurrentStateChanged(new RoutedEventArgs());

            UnwireVpaid();
            UnwireMediaPlayer();
        }
        internal VpaidLinearAdViewModel(IVpaid vpaid, MediaPlayer mediaPlayer)
        {
            MediaPlayer = mediaPlayer;
            Vpaid = vpaid;
            if (Vpaid is IVpaid2)
            {
                Vpaid2 = Vpaid as IVpaid2;
            }
            state = vPaidState.None;

            WireVpaid();
            WireMediaPlayer();
        }
        internal VpaidLinearAdViewModel(IVpaid vpaid, MediaPlayer mediaPlayer)
        {
            MediaPlayer = mediaPlayer;
            Vpaid       = vpaid;
            if (Vpaid is IVpaid2)
            {
                Vpaid2 = Vpaid as IVpaid2;
            }
            state = vPaidState.None;

            WireVpaid();
            WireMediaPlayer();
        }
 void vpaid_AdError(object sender, VpaidMessageEventArgs e)
 {
     state = vPaidState.Failure;
     NotifyIsPlayResumeEnabledChanged();
     NotifyIsPauseEnabledChanged();
     OnCurrentStateChanged(new RoutedEventArgs());
 }
 void vpaid_AdLoaded(object sender, object e)
 {
     state = vPaidState.Loaded;
     OnPropertyChanged(() => Duration);
     OnPropertyChanged(() => TimeRemaining);
     OnPropertyChanged(() => SignalStrength);
     OnPropertyChanged(() => MediaQuality);
     OnCurrentStateChanged(new RoutedEventArgs());
     estimatedDuration = Vpaid.AdRemainingTime;  // used to estimate the duration of the ad for vpaid 1.1
 }
 void vpaid_AdStarted(object sender, object e)
 {
     state = vPaidState.Playing;
     NotifyIsPlayResumeEnabledChanged();
     NotifyIsPauseEnabledChanged();
     OnCurrentStateChanged(new RoutedEventArgs());
 }
        void vpaid_AdStopped(object sender, object e)
        {
            state = vPaidState.Completed;
            NotifyIsPlayResumeEnabledChanged();
            NotifyIsPauseEnabledChanged();
            OnCurrentStateChanged(new RoutedEventArgs());

            UnwireVpaid();
            UnwireMediaPlayer();
        }