c# - How to update Cached Page from an Asyn Task After Navigating to another Page? -
c# - How to update Cached Page from an Asyn Task After Navigating to another Page? -
i navigating page page when background downloading work going on. in page 1, i'm updating progress bar based on progress received. i've cached page1 before navigating page 2.
but when navigate page1, view not updated if have updated model , notified using mvvm method. w've verified progress completed , file downloaded.
we using below code cache page.
this.navigationcachemode = navigationcachemode.enabled;
i wondering why view not updated, if have tried update it. if not navigating page, progress updated. sure work on normal case except on caching.
please help on situation.
clearing cache should help you
override next in caller page
protected override void onnavigatingfrom(navigatingcanceleventargs e) { if (e.uri.tostring().contains("/target")) { frame parentframe = (frame) parent; var cachesize = parentframe.cachesize; parentframe.cachesize = 0; parentframe.cachesize = cachesize; } base.onnavigatingfrom(e); }
replace /target
intended url or replace status own logic eg. after update view model or both
idea behind see when navigating
cached target
set cache size
of frame 0
clear cache
, restore back
original limit start caching again.
note method effective navigationcachemode.enabled
may not work navigationcachemode.required
more hard clear.
c# wpf mvvm
Comments
Post a Comment