private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { // Since these events can come from a non-main/UI thread, dispatch properly. System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate() { textBlock.Text += "adView_AdFailed Exception:" + e.Exception.Message + "\n\n"; }); }
async private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { // Since these events can come from a non-main/UI thread, dispatch properly. await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate() { textBlock.Text += "adView_AdFailed Exception:" + e.Exception.Message + "\n\n"; }); }
private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { if (sender != adView) { return; } System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate() { adView.Visibility = System.Windows.Visibility.Collapsed; }); }
private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { if (sender != adView) { return; } System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate() { // Remove any existing ad content (last rendered ad). // The ad control itself will still be displayed but appear as if no ad has been loaded. adView.RemoveContent(); }); }
private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { if (sender != adView) { return; } System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate() { // Remove any existing ad content (last rendered ad). adView.RemoveContent(); // Load the image resource to display when the adView fails to load a new ad. System.Windows.Media.Imaging.BitmapImage bitmapImage = new System.Windows.Media.Imaging.BitmapImage(new Uri("/ErrorImage.png", UriKind.Relative)); // Use the adView's own containers to render the image. adView.ImageControl.Source = bitmapImage; adView.ImageBorder.Child = adView.ImageControl; // Add the border as a child to the ad. This way when/if a new ad is rendered the adView will handle resetting everything properly. adView.Children.Add(adView.ImageBorder); }); }
private void adView_AdFailed(object sender, mast.MASTAdView.AdFailedEventArgs e) { string entry = "adView_AdFailed Exception:" + e.Exception; addEntry(entry); }