1 out of 1 rated this helpful - Rate this topic

Drag and Drop Using the Visual Studio 2012 Designer

Microsoft Advertising Services

Drag and drop the AdControl into a Windows 8 XAML app using the Visual Studio 2012 Designer.

Before You Begin

  • Before you can use the SDK, you must have Windows 8, a version of Visual Studio 2012 Windows 8, and the SDK installed on your system. For more information, see Getting Started.

Integrate an AdControl into an App Using the Visual Studio 2012 Visual Designer

  1. In Visual Studio, open the FILE menu and click New Project…. The New Project window is shown.

    New Project Window in VS
  2. From the Templates section (on the left), expand Visual C# and click Windows style. Click Blank App (XAML). Name the project (for example, AdControlTest) and click OK.

  3. In the Toolbox, you should see the AdControl in the Windows Advertising tab. Hint: If no controls are shown you may need to right click in the Toolbox and select Show All.

    VS Designer Main Page
  4. In the Solution Explorer window, double click MainPage.xaml. Visual Studio will load the Designer on the MainPage.xaml tab.

    AdControl in the VS Toolbox
  5. Drag and drop the AdControl into the Application Designer. Position the AdControl so that it is fully visible in the Application Designer.

    Drag and Drop the AdControl
  6. If you want to explore the properties of the AdControl, in the Application Designer click the AdControl, then in the Properties window expand the Advertising category.

  7. Compile and run the app to see it with an ad, similar to the following:

    Ad in Tablet Emulator

Consult the TestMode topic for various AdUnitId types to see a variety of ad sizes.

See the API Reference for additional targeting properties, methods for doing manual ad refreshes, and callback functions.

See Also


Report a bug in the product. Send email to psupport@microsoft.com.
Send feedback about this documentation to adsfdbk@microsoft.com.
Revised: 2013-01-31
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.