Saturday, 8 June 2013

WebView Z Order Again–This time with AdControl

Back in October, when I was trying to get our Travel Advisories app release we ran across a problem with flyouts and z-order.

What happened was that when you popped open a flyout, our HTML views would appear on top of the flyout, as we’re working in XAML and not Javascript (Javascript have a flyout that works on the other hand, apparently)

It’s probably old news to some of you, but today we tried to add advertising to a Windows Store app, and came across the same problem.  The flyout has the advertisement floating on top of it.

I started with the samples Developer Walkthroughs (XAML) on the MSDN site, and sure enough my control suffered.  I was certain there had to be a solution, but as is typical for Windows development, it’s never easy to find it.

You end up on pages like this that fleetingly suggest UseStaticAnchor which is of course the actual solution, but the list of properties doesn’t even show it.

Other documentation around the web suggests Resume and Suspend which has now been superseded.

The moral of the story:  Set UseStaticAnchor=”True”  in your XAML.

What Microsoft Should Do

Maybe we’ll be lucky and in 8.1, they’ll get rid of this problem with the WebView Z Order.  I’m not holding my breath, and you probably shouldn’t either.

No comments:

Post a Comment