问题
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