久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <tfoot id='tIjvv'></tfoot>

        <i id='tIjvv'><tr id='tIjvv'><dt id='tIjvv'><q id='tIjvv'><span id='tIjvv'><b id='tIjvv'><form id='tIjvv'><ins id='tIjvv'></ins><ul id='tIjvv'></ul><sub id='tIjvv'></sub></form><legend id='tIjvv'></legend><bdo id='tIjvv'><pre id='tIjvv'><center id='tIjvv'></center></pre></bdo></b><th id='tIjvv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tIjvv'><tfoot id='tIjvv'></tfoot><dl id='tIjvv'><fieldset id='tIjvv'></fieldset></dl></div>
          <bdo id='tIjvv'></bdo><ul id='tIjvv'></ul>

      1. <legend id='tIjvv'><style id='tIjvv'><dir id='tIjvv'><q id='tIjvv'></q></dir></style></legend>

        <small id='tIjvv'></small><noframes id='tIjvv'>

        刪除 Pages windows phone

        Remove Pages windows phone(刪除 Pages windows phone)

          • <i id='FjIHi'><tr id='FjIHi'><dt id='FjIHi'><q id='FjIHi'><span id='FjIHi'><b id='FjIHi'><form id='FjIHi'><ins id='FjIHi'></ins><ul id='FjIHi'></ul><sub id='FjIHi'></sub></form><legend id='FjIHi'></legend><bdo id='FjIHi'><pre id='FjIHi'><center id='FjIHi'></center></pre></bdo></b><th id='FjIHi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='FjIHi'><tfoot id='FjIHi'></tfoot><dl id='FjIHi'><fieldset id='FjIHi'></fieldset></dl></div>

            <legend id='FjIHi'><style id='FjIHi'><dir id='FjIHi'><q id='FjIHi'></q></dir></style></legend>

            <small id='FjIHi'></small><noframes id='FjIHi'>

          • <tfoot id='FjIHi'></tfoot>

                <bdo id='FjIHi'></bdo><ul id='FjIHi'></ul>

                    <tbody id='FjIHi'></tbody>
                  本文介紹了刪除 Pages windows phone的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一個(gè)大項(xiàng)目,我的應(yīng)用程序一直保留我導(dǎo)航離開(kāi)的頁(yè)面.該頁(yè)面僅使用最少,并且有很多圖形,因此我希望將其從內(nèi)存中完全刪除.

                  I have a big project where my application keeps retaining a page which I navigated away from. The page is only used minimal, and have a lot of graphics, I therefore want it to be completely removed from memory.

                  因此我使用了以下

                   NavigationService.RemoveBackEntry();
                  

                  使用我看到的分析器,上面的代碼片段確保我只有 1 個(gè)頁(yè)面實(shí)例.但由于它的圖形很重,我仍然希望它完全從內(nèi)存中刪除,即分析器中沒(méi)有實(shí)例.

                  Using the profiler I saw that, the above snippet made sure that I would only have 1 instance of the page. But as it is heavy with graphics I still want it to be completely removed from memory, i.e. no instances in the profiler.

                  在我的大型應(yīng)用程序中,我嘗試取消訂閱所有事件,引入 dispose/finalize 和調(diào)用 GC,它有所幫助,但實(shí)例仍然存在.

                  In my big application I tried to unsubscribe to all events, introduce dispose/finalize and calling GC, it helped some but the instance still existed.

                  為了排除任何愚蠢的錯(cuò)誤,我制作了 這個(gè)小樣本.僅使用內(nèi)存彈出檢查器在兩個(gè)啞頁(yè)面之間導(dǎo)航.但是仍然存在 1-2 個(gè)頁(yè)面實(shí)例.是否有強(qiáng)制刪除頁(yè)面以使其沒(méi)有任何內(nèi)容存儲(chǔ)在內(nèi)存中的方法?

                  To exclude any stupid errors, I have made this small sample. Only Navigating between two dumb pages with a memory popup checker. But still 1-2 instances of the pages still exists. Is there anyway to force the removal of pages such that nothing of it is stored in memory?

                  我已添加:

                              while (App.RootFrame.RemoveBackEntry() != null) ;
                  

                  到 OnNavigated to,它會(huì)刪除除我開(kāi)始的第一頁(yè)之外的所有頁(yè)面.我使用了調(diào)試分析工具包,可以看到無(wú)論我從哪個(gè)頁(yè)面開(kāi)始,當(dāng)我離開(kāi)它時(shí),它都不會(huì)被刪除.

                  To the OnNavigated to, and it removes all the pages except the first page I start on. I've used the debug analysis toolkit, and can see that no matter what the first page I start on does not get removed, when I navigate away from it.

                  推薦答案

                  WP Silverlight 運(yùn)行時(shí)將在內(nèi)存中最多保留三頁(yè),即使從后臺(tái)堆棧中刪除也是如此.我仍然不清楚這種行為的原因,但我找到了一個(gè)(丑陋的)解決方法:http://blogs.codes-sources.com/kookiz/archive/2013/11/11/wpdev-give-that-memory-back.aspx

                  The WP Silverlight runtime will keep up to three pages in memory, even after being removed from the backstack. The reason for this behavior is still unclear to me, but I've found a (ugly) workaround: http://blogs.codes-sources.com/kookiz/archive/2013/11/11/wpdev-give-that-memory-back.aspx

                  基本上,覆蓋頁(yè)面的 OnNavigatedTo 處理程序,并強(qiáng)制垃圾回收 3 次,通過(guò)調(diào)用調(diào)度程序分開(kāi):

                  Basically, override the OnNavigatedTo handler of your page, and force a garbage collection three times, separated by calls to the dispatcher:

                  protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
                  {
                      base.OnNavigatedTo(e);
                  
                      this.Dispatcher.BeginInvoke(() =>
                      {
                          GC.Collect();
                          GC.WaitForPendingFinalizers();
                  
                          this.Dispatcher.BeginInvoke(() =>
                          {
                              GC.Collect();
                              GC.WaitForPendingFinalizers();
                  
                              this.Dispatcher.BeginInvoke(() =>
                              {
                                  GC.Collect();
                                  GC.WaitForPendingFinalizers();
                              });
                          });
                      });
                  }
                  

                  聽(tīng)起來(lái)很瘋狂,但它確實(shí)有效.

                  As crazy as it sounds, it works.

                  在您的情況下,您還有另一個(gè)問(wèn)題.您通過(guò)彈出窗口使頁(yè)面保持活力.讓我解釋一下:

                  In your case, you have another problem. You are keeping the page alive with your popup. Let me explain:

                  CreatePopups 方法中,您創(chuàng)建彈出窗口并將其添加到起始頁(yè)的網(wǎng)格中.在彈出窗口中,您啟動(dòng)一??個(gè)計(jì)時(shí)器以定期調(diào)用 UpdateMemoryInfo.計(jì)時(shí)器由 .NET 運(yùn)行時(shí)保持活動(dòng)狀態(tài),直到它停止.計(jì)時(shí)器會(huì)在您的彈出窗口中保留一個(gè)引用,因?yàn)槟褂脤?shí)例方法作為事件處理程序.您的彈出窗口通過(guò) Parent 屬性保持對(duì)網(wǎng)格的引用.網(wǎng)格通過(guò)其自己的 Parent 屬性保持對(duì)頁(yè)面的引用.所以你只是讓你的頁(yè)面不朽,只要你的計(jì)時(shí)器在滴答作響.要證明問(wèn)題存在,只需將 UpdateMemoryInfo 方法設(shè)為靜態(tài)(并刪除其中的所有 UI 更新代碼).由于事件處理程序現(xiàn)在是靜態(tài)的,因此計(jì)時(shí)器不會(huì)保存對(duì)彈出實(shí)例的引用.運(yùn)行分析器,您會(huì)看到頁(yè)面實(shí)例現(xiàn)在已按預(yù)期被垃圾收集器回收.

                  In the CreatePopups method, you create the popup and add it to the grid of the starting page. In the popup, you start a timer to call UpdateMemoryInfo at regular interval. The timer is kept alive by the .NET runtime until it's stopped. The timer keeps a reference on your popup because you're using an instance method as event handler. Your popup is keeping a reference to the grid through the Parent property. The grid is keeping a reference to the page through its own Parent property. So you just made your page immortal, for as long as your timer is ticking. To prove that the issue is there, just make the UpdateMemoryInfo method static (and remove all the UI updating code there's inside). Since the event handler is now static, the timer won't hold a reference to instance of popup. Run the profiler, and you'll see that the instance of the page is now reclaimed by the garbage collector as you expect.

                  當(dāng)然,它假定您的頁(yè)面已從后臺(tái)堆棧中刪除.通過(guò)按返回鍵或調(diào)用 NavigationService.GoBack() 方法,或使用 NavigationService.RemoveBackEntry() 手動(dòng)刪除它們(如果您只使用向前導(dǎo)航)

                  Of course, it supposes that your pages have been removed from the back stack. Either by pressing the back key or calling the NavigationService.GoBack() method, or by manually removing them using NavigationService.RemoveBackEntry() (in case you only use forward navigation)

                  這篇關(guān)于刪除 Pages windows phone的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時(shí)忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯(cuò)誤的 XML)
                  <i id='iNG9S'><tr id='iNG9S'><dt id='iNG9S'><q id='iNG9S'><span id='iNG9S'><b id='iNG9S'><form id='iNG9S'><ins id='iNG9S'></ins><ul id='iNG9S'></ul><sub id='iNG9S'></sub></form><legend id='iNG9S'></legend><bdo id='iNG9S'><pre id='iNG9S'><center id='iNG9S'></center></pre></bdo></b><th id='iNG9S'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iNG9S'><tfoot id='iNG9S'></tfoot><dl id='iNG9S'><fieldset id='iNG9S'></fieldset></dl></div>
                1. <legend id='iNG9S'><style id='iNG9S'><dir id='iNG9S'><q id='iNG9S'></q></dir></style></legend>

                  <small id='iNG9S'></small><noframes id='iNG9S'>

                        <tbody id='iNG9S'></tbody>

                      <tfoot id='iNG9S'></tfoot>
                          <bdo id='iNG9S'></bdo><ul id='iNG9S'></ul>

                            主站蜘蛛池模板: 国产色网 | 在线国产视频观看 | 日韩高清国产一区在线 | 亚洲成人一区二区 | 亚洲国产成人一区二区 | 日本免费在线看 | 97福利在线 | 九九九国产 | 精品一二三区在线观看 | 性高湖久久久久久久久3小时 | zzzwww在线看片免费 | av国产精品 | 国产精品一区视频 | 国产福利91精品 | 大香在线伊779 | 久久人人爽人人爽人人片av免费 | 密室大逃脱第六季大神版在线观看 | 欧美日韩一本 | 日韩成人在线看 | 欧美淫片 | 在线视频成人 | 亚洲国产精品人人爽夜夜爽 | 国产一级片| 成人在线中文字幕 | 久久精品小视频 | 99久久99 | 美女黄视频网站 | 精品国产乱码久久久久久丨区2区 | 99在线资源| 一级黄色毛片免费 | 成人网av| 欧美在线观看一区 | 九九精品在线 | 九九九视频精品 | 欧美日本一区二区 | 一级毛片观看 | 91社影院在线观看 | 亚洲精品久久久久久久久久久 | 欧美伊人影院 | 亚洲精品一区二区在线观看 | 午夜性视频 |