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

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

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

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

        <legend id='Y7AzF'><style id='Y7AzF'><dir id='Y7AzF'><q id='Y7AzF'></q></dir></style></legend>
        <tfoot id='Y7AzF'></tfoot>
      1. 在 WP7 Silverlight 應(yīng)用程序中導(dǎo)航時(shí)將復(fù)雜對象傳遞

        Passing a complex object to a page while navigating in a WP7 Silverlight application(在 WP7 Silverlight 應(yīng)用程序中導(dǎo)航時(shí)將復(fù)雜對象傳遞到頁面)
          <bdo id='ddfao'></bdo><ul id='ddfao'></ul>

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

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

                <legend id='ddfao'><style id='ddfao'><dir id='ddfao'><q id='ddfao'></q></dir></style></legend>
                • 本文介紹了在 WP7 Silverlight 應(yīng)用程序中導(dǎo)航時(shí)將復(fù)雜對象傳遞到頁面的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我一直在使用 NavigationServiceNavigate 方法導(dǎo)航到我的 WP7 Silverlight 應(yīng)用程序中的其他頁面:

                  I have been using the NavigationService's Navigate method to navigate to other pages in my WP7 Silverlight app:

                  NavigationService.Navigate(new Uri("/Somepage.xaml?val=dreas", UriKind.Relative));
                  

                  Somepage.xaml,然后我檢索查詢字符串參數(shù)如下:

                  From Somepage.xaml, I then retrieve the query string parameters as follows:

                  string val;
                  NavigationContext.QueryString.TryGetValue("val", out val);
                  

                  <小時(shí)>

                  我現(xiàn)在需要一種使用類似方式傳遞復(fù)雜對象的方法.每次我需要將對象傳遞到新頁面時(shí),如何不必序列化對象?


                  I now need a way to pass a complex object using a similar manner. How can I do this without having to serialize the object every time I need to pass it to a new page?

                  推薦答案

                  這是一個(gè)極其復(fù)雜的問題,這里沒有簡單的解決方案.沒有任何神奇的 API 可以適用于任何應(yīng)用來解決這個(gè)問題.

                  This is an extremely complex problem, and there is no simple solution here. There is no magic API that would just work for any app to solve this problem.

                  傳遞導(dǎo)航數(shù)據(jù)的核心問題是墓碑.默認(rèn)情況下唯一被墓碑化的數(shù)據(jù)是導(dǎo)航 URI.因此,如果您使用的是 QueryString 參數(shù),它將被墓碑和您的代碼自動拾取.但是,任何時(shí)候您手動傳遞對象的實(shí)例時(shí),您都必須自己手動為該實(shí)例執(zhí)行墓碑.

                  The core problem with passing navigation data is Tombstoning. The only piece of data that is tombstoned by default is the Navigation URI. so if you're using a QueryString parameter, it'll get picked up automatically by tombstoning and your code. Any time you'll manually pass a instance of an object though, you'll have to manually do tombstoning for that instance yourself.

                  因此,如果您導(dǎo)航到/CowDetails.xaml?ID=1",您的頁面可能只需選擇 ID Querystring 參數(shù)即可擁有完美的墓碑.但是,如果您以某種方式為 CowDetails 頁面提供new Cow() { ID = 1}",則必須確保自己墓碑化并僵尸化此值.

                  So, if you navigate to "/CowDetails.xaml?ID=1" your page will probably have perfect tombstoning just by picking up on the ID Querystring Parameter. However, if you somehow provide CowDetails page with a "new Cow() { ID = 1}" you'll have to make sure to tombstone and zombificate this value yourself.

                  還有時(shí)間問題.在調(diào)用 NavigationService.Navigate 時(shí),您正在導(dǎo)航的頁面還沒有實(shí)際實(shí)例.因此,即使您正在導(dǎo)航到 FooPage 并準(zhǔn)備好 FooData,也無法立即將 FooPage 連接到 FooData.您必須等到 PhoneApplicationFrame.Navigated 事件觸發(fā)后才能為 FooPage 提供 FooData.

                  Also, there's the issue of timing. While calling NavigationService.Navigate, the page you're navigating too doesn't have an actual instance yet. So even though you're navigating to FooPage and have the FooData ready, there's no way to immediately connect FooPage to FooData. You'll have to wait until the PhoneApplicationFrame.Navigated event has fired in order to provide FooPage with FooData.

                  我通常處理這個(gè)問題的方式是:

                  The way I normally deal with this is problem:

                  1. 擁有一個(gè)帶有 Object 類型 Data 屬性的 BasePage
                  2. 讓 NavigationHelper 獲取頁面 URI 和數(shù)據(jù):NavigationHelper.Navigate("foo.xaml", fooData)
                  3. 讓 NavigationHelper 注冊到 PhoneApplicationFrame.Navigated 事件,如果它是foo.xaml",則將 BasePage.Data 設(shè)置為 FooData.
                  4. 讓 BasePage 使用 JSON.Net 墓碑和僵尸化 BasePage.Data.
                  5. 在 BasePage 上,我有一個(gè) OnDataSet 虛擬方法,一旦通過 Zombification 或 Navigation 填充 Data 屬性,就會調(diào)用該方法.在這種方法中,與業(yè)務(wù)數(shù)據(jù)有關(guān)的一切都會發(fā)生.

                  這篇關(guān)于在 WP7 Silverlight 應(yīng)用程序中導(dǎo)航時(shí)將復(fù)雜對象傳遞到頁面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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)
                  • <bdo id='Opm0P'></bdo><ul id='Opm0P'></ul>

                          • <small id='Opm0P'></small><noframes id='Opm0P'>

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

                            <tfoot id='Opm0P'></tfoot><legend id='Opm0P'><style id='Opm0P'><dir id='Opm0P'><q id='Opm0P'></q></dir></style></legend>
                          • 主站蜘蛛池模板: k8久久久一区二区三区 | 看片天堂| 天天干天天玩天天操 | 国产精品成人在线播放 | 国产一区免费视频 | 一级黄色av电影 | 91久久国产精品 | 色婷婷国产精品 | 在线免费观看黄视频 | 国产二区三区 | 99精品国产一区二区三区 | 国产91av视频| 欧美一区二区成人 | 国产精品18久久久 | 高清成人av | 99在线免费观看视频 | 国产一区二区三区四区五区加勒比 | 一级黄色播放 | 亚洲一区二区在线播放 | 久久久看 | 国产精品成人品 | 精品久久久久一区二区国产 | 伊人在线视频 | 一区二区国产在线 | 午夜小视频在线观看 | 男人av在线播放 | 亚洲精品一二区 | 成人片免费看 | 一区二区三区四区在线 | 日韩毛片网 | 中文字幕色站 | 欧美一区二区综合 | 久久综合伊人 | 99精品国自产在线 | 91久久久久久久久久久久久 | 午夜影视网 | 久久久不卡网国产精品一区 | 国产黄色av电影 | 日韩av在线一区二区 | 成人免费区一区二区三区 | 亚洲一区二区成人 |