The Windows 8 version needs Suspend/Resume

Dec 7, 2012 at 4:21 PM

The MS ad control has an annoying problem with z-order in that it's always on top of everything unless either you hide the control (which can cause layout issues) or if you call Suspend (and then Resume when you're done). For example, I show my ad at the bottom where the app bar is, but when I show the app bar, the MS ad control will cover up the app bar beneath it. That's why they added the Suspend/Resume methods to the MS ad control. Calling Suspend will hide the actual ad, but the control will still take up the same room as when the ad is shown.

Here's what I added to AdRotatorWin8\AdRotatorControl.cs in my own private copy to get this to work:

        public void Suspend()
        {
            Microsoft.Advertising.WinRT.UI.AdControl msAd =
                this._currentAdControl as Microsoft.Advertising.WinRT.UI.AdControl;
            if (msAd != null)
            {
                msAd.Suspend();
            }
        }

        public void Resume()
        {
            Microsoft.Advertising.WinRT.UI.AdControl msAd =
                this._currentAdControl as Microsoft.Advertising.WinRT.UI.AdControl;
            if (msAd != null)
            {
                msAd.Resume();
            }
        }

Dec 10, 2012 at 11:39 AM

Thanks, added into the codebase for 1.08 of the Windows 8 Control

Dec 11, 2012 at 12:39 PM

Windows 8 NuGet package updated, check it out and let me know