在UWP中导航后,AdControl停止更新 [英] AdControl stops updating after navigating back in UWP
问题描述
您好,我正在将MVVM Windows Phone 8.1应用程序更新为UWP,并遇到了问题。
Hello I'm updating a MVVM Windows phone 8.1 app to UWP and have run into a problem.
当应用程序午餐时,adControl可以正确显示广告,但是当用户随后导航到另一个页面然后返回adControl时,它便停止了更新。
The adControl correctly shows ads when the app is lunched, but when the user then navigates to a different page and then back the adControl simply stops updating.
我已设置:
IsAutoRefreshEnabled="True"
和
AutoRefreshIntervalInSeconds="60"
我还尝试检查
ErrorOccurred="AdControl_ErrorOccurred"
,但导航返回后在此没有触发。
but nothing fires here after navigation back.
我正在使用
SystemNavigationManager
允许用户向后导航。
推荐答案
对于仍在努力解决此Microsoft尚未在2016年3月28日修复的bug的人,我所做的是改用admeditator(它也有bug),然后调用以下命令
For anyone still struggling with this bug that Microsoft has still not on 28-03-2016 fixed, what I did was use admeditator instead(it also has the bug), and then call the following on page navigation.
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
this.AdMediator_ECB2E3.Disable();
base.OnNavigatingFrom(e);
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
this.AdMediator_ECB2E3.Resume();
base.OnNavigatedTo(e);
}
这篇关于在UWP中导航后,AdControl停止更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!