AdControl class

AdControl class

Represents a control that displays banner ads in an app. For walkthroughs and code examples that demonstrate how to use this control, see AdControl in XAML and .NET, AdControl in HTML 5 and JavaScript and Advertising samples on GitHub.

Syntax


public ref class AdControl sealed : StackPanel,
    IScrollSnapPointsInfo,
    IClosable

Members

The AdControl class has these types of members:

Constructors

The AdControl class has these constructors.

ConstructorDescription
AdControl Initializes a new instance of the AdControl class.

 

Events

The AdControl class has these events.

EventDescription
AdRefreshed Raised when the AdControl receives a new banner ad.
ErrorOccurred Raised when the AdControl encounters an operational error.
IsEngagedChanged Raised when the user clicks the banner ad and is interacting with it rather than the app.
OnManipulationStateChanged Raised when the AdControl receives a manipulation state changed event from the banner ad.
OnMouseWheel Raised when the AdControl receives a mouse wheel event.
OnPointerDown Raised when the user clicks, points, or touches the banner ad.
OnPointerMove Raised when the pointing device is moved.
OnPointerUp Raised when the user has stopped clicking, pointing, or touching a banner ad.

 

Methods

The AdControl class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
AddAdTag Adds an ad tag to the AdControl.
Dispose Disposes the ad control and frees resources used by the control.
Refresh Directs the AdControl to show the next ad when a new one becomes available, if auto-refresh is disabled.
RemoveAdTag Removes an ad tag from the AdControl.
Resume Resumes the normal display of a banner ad after a call to Suspend.
Suspend Suspends the current banner ad and replaces the current view of the banner ad with a static snapshot of what was being rendered.

 

Properties

The AdControl class has these properties.

PropertyAccess typeDescription

AdUnitId

Read/write

Gets or sets the ad unit identifier for this AdControl object. This value is available in Windows Dev Center.

ApplicationId

Read/write

Gets or sets the application ID for this AdControl object. This value is available in Windows Dev Center.

AutoRefreshIntervalInSeconds

Read/write

Gets or sets the interval at which the AdControl refreshes the currently displayed banner ad, in seconds.

CountryOrRegion

Read/write

Gets or sets the user’s two-letter country or region code.

HasAd

Read-only

Gets a value that indicates whether or not the AdControl is currently serving a banner ad.

IsAutoRefreshEnabled

Read/write

Gets or sets a value that indicates whether automatic rotation of banner ads is enabled.

IsEngaged

Read-only

Gets a value that indicates whether the user is interacting with the banner ad.

IsSuspended

Read-only

Gets a value that indicates whether the AdControl is in a suspended state.

Keywords

Read/write

Gets or sets the keywords that target the audience for advertisements.

PostalCode

Read/write

Gets or sets the postal code to target for the banner ad.

 

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1

Namespace

Microsoft.Advertising.WinRT.UI
Microsoft::Advertising::WinRT::UI [C++]

Metadata

Microsoft.Advertising.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version]
[WebHostHidden()]

See also

Object
IScrollSnapPointsInfo
IClosable
AdControl in XAML and .NET
AdControl in HTML 5 and JavaScript
Advertising samples on GitHub

 

 

Show:
© 2017 Microsoft