/// <summary> /// Creates a new instance of VpaidImageAdPlayer. /// </summary> /// <param name="skippableOffset">The position in the ad at which the ad can be skipped. If null, the ad cannot be skipped.</param> /// <param name="suggestedDuration">The duration of the ad. If not specified, the ad is closed when the next ad is played.</param> /// <param name="clickThru">The Uri to navigate to when the ad is clicked or tapped. Can be null of no action should take place.</param> /// <param name="dimensions">The dimensions of the ad.</param> public VpaidWebAdPlayer(FlexibleOffset skippableOffset, TimeSpan?suggestedDuration, Uri clickThru, Size dimensions) { IsHitTestVisible = false; #if WINDOWS_PHONE WebView = new Phone.Controls.WebBrowser(); #elif SILVERLIGHT WebView = new WebBrowser(); #else WebView = new WebView(); #endif WebView.Visibility = Visibility.Collapsed; Background = new SolidColorBrush(Colors.Transparent); State = AdState.None; AdLinear = false; InitialDimensions = dimensions; SkippableOffset = skippableOffset; SuggestedDuration = suggestedDuration; ClickThru = clickThru; this.NavigateUri = ClickThru; }
/// <summary> /// Creates a new instance of VpaidImageAdPlayer. /// </summary> /// <param name="skippableOffset">The position in the ad at which the ad can be skipped. If null, the ad cannot be skipped.</param> /// <param name="suggestedDuration">The duration of the ad. If not specified, the ad is closed when the next ad is played.</param> /// <param name="clickThru">The Uri to navigate to when the ad is clicked or tapped. Can be null of no action should take place.</param> /// <param name="dimensions">The dimensions of the ad.</param> public VpaidWebAdPlayer(FlexibleOffset skippableOffset, TimeSpan? suggestedDuration, Uri clickThru, Size dimensions) { IsHitTestVisible = false; #if WINDOWS_PHONE WebView = new Phone.Controls.WebBrowser(); #elif SILVERLIGHT WebView = new WebBrowser(); #else WebView = new WebView(); #endif WebView.Visibility = Visibility.Collapsed; Background = new SolidColorBrush(Colors.Transparent); State = AdState.None; AdLinear = false; InitialDimensions = dimensions; SkippableOffset = skippableOffset; SuggestedDuration = suggestedDuration; ClickThru = clickThru; this.NavigateUri = ClickThru; }