NativeAd class
Represents a native ad, which is an ad format where all the components of the ad (including the title, image, description, and call to action text) are delivered to your app as separate elements. Use the properties of the NativeAd to get each element of the native ad. You can integrate these elements into your app using your own choice of fonts, colors, and animations to build an ad experience that fits the look and feel of your app. For a walkthrough that demonstrates how to use the NativeAd class in your app, including code examples, see Native ads.
Syntax
Members
The NativeAd class has these types of members:
Methods
The NativeAd class has these methods. It also inherits methods from the Object class.
| Method | Description |
|---|---|
| Dispose | Disposes the native ad and frees resources used by the control. |
| RegisterAdContainer(FrameworkElement) | Registers the specified UI element in your app that acts as a container for the native ad elements. When you use this method, the entire container is a clickable element for the ad. You must register the container to properly track ad impressions and clicks. |
| RegisterAdContainer(FrameworkElement,IVector(FrameworkElement)) | Registers the UI element in your app that acts as a container for the native ad elements and any specific UI elements that can be clicked by the user. You must register these components to properly track ad impressions and clicks. |
Properties
The NativeAd class has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only | Gets a dictionary of key/value pairs that contain data for additional optional asset types (if present) for the native ad that do not have corresponding properties in the NativeAd class. | |
|
Read-only | Gets the ad icon supplied by Microsoft. This icon is intended to be shown in your native ad experience to help differentiate the ad from the rest of your app. | |
|
Read-only | Gets the call to action text for the native ad. | |
|
Read-only | Gets the description for the native ad. | |
|
Read-only | Gets the icon image for the native ad, as supplied by the ad sponsor. | |
|
Read-only | Gets the main images for the native ad, as supplied by the ad sponsor. | |
|
Read-only | Gets the price of the product that is being advertised in the native ad, including a currency symbol. | |
|
Read-only | Gets the rating of the product that is being advertised in the native ad. | |
|
Read-only | Gets the brand name of the sponsor for the product that is being advertised in the native ad. | |
|
Read-only | Gets the title for the native ad. |
Requirements
|
Minimum supported client |
Windows 10 [Windows Store apps only] |
|---|---|
|
Minimum supported server |
None supported |
|
Minimum supported phone |
Windows 10 Mobile |
|
Namespace |
|
|
Metadata |
|
Attributes
- [MarshalingBehavior(Agile)]
- [Threading(STA)]
- [Version]
- [WebHostHidden()]
See also