Export (0) Print
Expand All

C# Callback Events - Windows 8.1

Microsoft Advertising Services

Updated: October 17, 2013

Published: April 1, 2014

For C# there are three optional AdControl events that you can catch and handle in code.

For more information about handling events in C# see the topic Events and routed events overview (Windows Store apps using C#/VB/C++ and XAML).

The snippets below provide an example of how to define those events. It assumes you have previously assigned the event handlers to the AdControl events. To learn how to do that in XAML see the topic XAML Markup with All Properties.

Example

private void OnAdError(object sender, AdErrorEventArgs e) {
  // place code here for when there is an error serving an ad
  // e.g. you may opt to show a default experience, or reclaim the div for other purposes
  return;
}

private void OnAdRefresh(object sender, RoutedEventArgs e) {
  // place code here that you wish to execute when the ad refreshes.
 return;
}

private void OnAdEngagedChanged(object sender, RoutedEventArgs e) {
  // place code here for when there is an error serving an ad
  // e.g. you may opt to show a default experience, or reclaim the div for other purposes
  return;
}

For error events, you can learn more about how to handle them in the topic AdControl Error Handling.

Support and Feedback

Get product support or report a bug in the advertising SDK by visiting the Windows Store Apps developer support page support page. For product support, under "App development" click the "Advertising SDK" link. To post a question in the support forum, scroll down to "Find answers online" and click "Ads-in-Apps for Windows 8 forum".

Send feedback about this documentation to adsfdbk@microsoft.com. There is no product support through this alias. Documentation feedback only.

Community Additions

ADD
Show:
© 2014 Microsoft