AdControl stops updating after navigating back in UWP

好久不见. 提交于 2019-12-02 00:28:08

问题


Hello I'm updating a MVVM Windows phone 8.1 app to UWP and have run into a problem.

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.

I have set:

IsAutoRefreshEnabled="True"

and

AutoRefreshIntervalInSeconds="60"

i also tried checking

ErrorOccurred="AdControl_ErrorOccurred"

but nothing fires here after navigation back.

I am using the

SystemNavigationManager to let the user navigate back.


回答1:


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);
    }


来源:https://stackoverflow.com/questions/32068329/adcontrol-stops-updating-after-navigating-back-in-uwp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!