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.
| Constructor | Description |
|---|---|
| AdControl | Initializes a new instance of the AdControl class. |
Events
The AdControl class has these events.
| Event | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
|
Read/write | Gets or sets the ad unit identifier for this AdControl object. This value is available in Windows Dev Center. | |
|
Read/write | Gets or sets the application ID for this AdControl object. This value is available in Windows Dev Center. | |
|
Read/write | Gets or sets the interval at which the AdControl refreshes the currently displayed banner ad, in seconds. | |
|
Read/write | Gets or sets the user’s two-letter country or region code. | |
|
Read-only | Gets a value that indicates whether or not the AdControl is currently serving a banner ad. | |
|
Read/write | Gets or sets a value that indicates whether automatic rotation of banner ads is enabled. | |
|
Read-only | Gets a value that indicates whether the user is interacting with the banner ad. | |
|
Read-only | Gets a value that indicates whether the AdControl is in a suspended state. | |
|
Read/write | Gets or sets the keywords that target the audience for advertisements. | |
|
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 |
|
|
Metadata |
|
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