c# - Is there something funny with async OnNavigatedTo? -
i have 2 pages; mainpage
, settingspage
.
in mainpage, in onnavigatedto
method check isolated storage , if not match want app navigated settingspage
.
onnavigatedto
marked async
since i'm using awaited methods check on variable. works reads variable , reports needs navigate, call
this.frame.navigate(typeof(settingspage));
no errors being thrown. 70%++ of time call navigate method nothing! way of navigating between pages different windows phone? i'm doing exact same thing there, using urls instead of typeof(xxxpage)
what gives? seems not follow async
flag, since times manages navigate settingspage... 70%+ of times seems application ignores async onnavigatedto
, runs application synchronously.
i've placed debug.writeline on navigation event, , calls navigate(typeof(settingspage))
each time... seems fail somewhere?
i've encountered same behavior. queue new navigation @ low priority give first page load , app initialization chance complete.
public async virtual task navigateasync(type sourcepagetype) { await window.current.dispatcher.runasync(coredispatcherpriority.low, () => { ((frame)window.current.content).navigate(sourcepagetype); }); }
Comments
Post a Comment