資源簡(jiǎn)介
這是我自己做的win8應(yīng)用程序的源碼。你可以在這里開(kāi)始學(xué)習(xí)如何在win8上做應(yīng)用程序。
代碼片段和文件信息
using?Hirstyle_Introduces.Common;
using?System;
using?System.Collections.Generic;
using?System.IO;
using?System.Linq;
using?Windows.ApplicationModel;
using?Windows.ApplicationModel.Activation;
using?Windows.Foundation;
using?Windows.Foundation.Collections;
using?Windows.UI.Xaml;
using?Windows.UI.Xaml.Controls;
using?Windows.UI.Xaml.Controls.Primitives;
using?Windows.UI.Xaml.Data;
using?Windows.UI.Xaml.Input;
using?Windows.UI.Xaml.Media;
using?Windows.UI.Xaml.Navigation;
//?“拆分布局應(yīng)用程序”模板在?http://go.microsoft.com/fwlink/?linkId=234228?上有介紹
namespace?Hirstyle_Introduces
{
????///?
????///?提供特定于應(yīng)用程序的行為,以補(bǔ)充默認(rèn)的應(yīng)用程序類(lèi)。
????///?
????sealed?partial?class?App?:?Application
????{
????????///?
????????///?初始化單一實(shí)例應(yīng)用程序?qū)ο蟆_@是執(zhí)行的創(chuàng)作代碼的第一行,
????????///?邏輯上等同于?main()?或?WinMain()。
????????///?
????????public?App()
????????{
????????????this.InitializeComponent();
????????????this.Suspending?+=?OnSuspending;
????????}
????????///?
????????///?在應(yīng)用程序由最終用戶(hù)正常啟動(dòng)時(shí)進(jìn)行調(diào)用。
????????///?當(dāng)啟動(dòng)應(yīng)用程序以執(zhí)行打開(kāi)特定的文件或顯示搜索結(jié)果等操作時(shí)
????????///?將使用其他入口點(diǎn)。
????????///?
????????///?有關(guān)啟動(dòng)請(qǐng)求和過(guò)程的詳細(xì)信息。
????????protected?override?async?void?OnLaunched(LaunchActivatedEventArgs?args)
????????{
????????????frame?rootframe?=?Window.Current.Content?as?frame;
????????????//?不要在窗口已包含內(nèi)容時(shí)重復(fù)應(yīng)用程序初始化,
????????????//?只需確保窗口處于活動(dòng)狀態(tài)
????????????
????????????if?(rootframe?==?null)
????????????{
????????????????//?創(chuàng)建要充當(dāng)導(dǎo)航上下文的框架,并導(dǎo)航到第一頁(yè)
????????????????rootframe?=?new?frame();
????????????????//將框架與?SuspensionManager?鍵關(guān)聯(lián)????????????????????????????????
????????????????SuspensionManager.Registerframe(rootframe?“Appframe“);
????????????????if?(args.PreviousExecutionState?==?ApplicationExecutionState.Terminated)
????????????????{
????????????????????//?僅當(dāng)合適時(shí)才還原保存的會(huì)話(huà)狀態(tài)
????????????????????try
????????????????????{
????????????????????????await?SuspensionManager.RestoreAsync();
????????????????????}
????????????????????catch?(SuspensionManagerException)
????????????????????{
????????????????????????//還原狀態(tài)時(shí)出現(xiàn)問(wèn)題。
????????????????????????//假定沒(méi)有狀態(tài)并繼續(xù)
????????????????????}
????????????????}
????????????????//?將框架放在當(dāng)前窗口中
????????????????Window.Current.Content?=?rootframe;
????????????}
????????????if?(rootframe.Content?==?null)
????????????{
????????????????//?當(dāng)未還原導(dǎo)航堆棧時(shí),導(dǎo)航到第一頁(yè),
????????????????//?并通過(guò)將所需信息作為導(dǎo)航參數(shù)傳入來(lái)配置
????????????????//?參數(shù)
????????????????if?(!rootframe.Navigate(typeof(ItemsPage)?“AllGroups“))
????????????????{
????????????????????throw?new?Exception(“Failed?to?create?initial?page“);
????????????????}
????????????}
????????????//?確保當(dāng)前窗口處于活動(dòng)狀態(tài)
????????????Window.Current.Activate();
????????}
????????///?
????????///?在將要掛起應(yīng)用程序執(zhí)行時(shí)調(diào)用。在不知道應(yīng)用程序
????????///?將被終止還是恢復(fù)的情況下保存應(yīng)用程序狀態(tài),
????????///?并讓內(nèi)存內(nèi)容保持不變。
????????///?
????????///?掛起的請(qǐng)求的源。
????????///?有關(guān)掛起的請(qǐng)求的詳細(xì)信息。
????????priv
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2012-12-02?11:26??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????文件????????2647??2012-12-01?19:08??Hirst
?????文件???????10640??2012-12-02?11:24??Hirst
?????文件??????109056??2012-12-02?11:06??Hirst
?????文件?????????913??2012-12-01?19:08??Hirst
?????文件????????4013??2012-12-01?19:08??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????文件???????80356??2011-12-19?07:48??Hirst
?????文件?????????560??2012-04-02?23:39??Hirst
?????文件?????????560??2012-04-02?23:39??Hirst
?????文件???????31873??2012-12-01?19:01??Hirst
?????文件???????13910??2011-12-19?08:28??Hirst
?????文件?????????561??2012-04-02?23:39??Hirst
?????文件????????2557??2012-12-01?19:07??Hirst
?????文件??????144635??2012-12-01?18:46??Hirst
?????文件????????6175??2012-12-01?19:03??Hirst
?????文件???????11108??2011-12-19?08:28??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????目錄???????????0??2012-12-01?22:42??Hirst
?????目錄???????????0??2012-12-01?22:42??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????文件?????????915??2012-12-01?19:08??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????文件????????2300??2012-12-02?11:08??Hirst
?????文件?????????915??2012-12-01?19:08??Hirst
?????文件????????2300??2012-12-02?11:08??Hirst
?????目錄???????????0??2012-12-02?11:26??Hirst
?????文件???????80356??2011-12-19?07:48??Hirst
?????文件?????????560??2012-04-02?23:39??Hirst
............此處省略239個(gè)文件信息
評(píng)論
共有 條評(píng)論