Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
817 views
in Technique[技术] by (71.8m points)

c# - AdControl stops updating after navigating back in UWP

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...