0 out of 4 rated this helpful - Rate this topic

AdControl Class

Provides the information needed to show advertising in your application.

Namespace: Microsoft.Advertising.Mobile.UI

Assembly: Microsoft.Advertising.Mobile.UI (in Microsoft.Advertising.Mobile.UI.dll) Version: 6.1.909.0

public class AdControl :  UserControl

When the AdControl is created, the rotationEnabled parameter is set to true. The AdControl will then show a new ad every 30 to 60 seconds. If no new ad is shown, an error may have occurred in transmission or no new ad may be available.

If this behavior does not suit the application, you can instantiate the AdControl with automatic ad rotation deactivated. To do this, call the overloaded constructor with the rotationEnabled parameter set to false. This will allow the application to call the RequestNextAd method to show the next ad.

Use one or more unique instances of an AdControl on a page. Do not use the same instance of an AdControl across multiple pages.

Once set, the parent of an AdControl should not be changed.

All required properties of the AdControl need to be set when it is instantiated.

The following XAML is an example of instantiating a new AdControl with mandatory targeting parameters. Note: You must set the AdUnitId property before you can show an ad.

<Grid xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="1">
   <adctl:AdControl Height="80" Width="480" />
</Grid>

The following code instantiates a new AdControl that uses default test values and sets the ad refresh to manual.

AdControl ctrl = new AdControl();
ctrl.IsAutoRefreshEnabled = false;

Object :: DependencyObject :: UIElement :: FrameworkElement :: Control :: UserControl :: Microsoft.Advertising.Mobile.UI.AdControl


Send feedback about this documentation to adsfdbk@microsoft.com.
Publication date: 2012-10-30
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.