Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
825 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 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...