2014-09-26 96 views
0

在我的Windows Phone 8應用程序,我想保留我的應用程序的狀態,使用該link「ExecutionModelApplication」找不到(是否缺少using指令或程序集引用?)WP8 C#

而且在可見的Modifying the Page Class

的話題我修改我的MainPage類的構造函數,並添加這一行:

(Application.Current as ExecutionModelApplication.App).ApplicationDataObjectChanged += 
          new EventHandler(MainPage_ApplicationDataObjectChanged); 

要我MainPage類的構造函數一樣bwlow:

public MainPage() 
     { 
      InitializeComponent(); 
      // Sample code to localize the ApplicationBar 
      //BuildLocalizedApplicationBar(); 
      _isNewPageInstance = true; 

      // Set the event handler for when the application data object changes. 
      (Application.Current as ExecutionModelApplication.App).ApplicationDataObjectChanged += 
          new EventHandler(MainPage_ApplicationDataObjectChanged); 
     } 

但我在ExecutionModelApplication收到以下錯誤:

The type or namespace name 'ExecutionModelApplication' could not be found (are you missing a using directive or an assembly reference?)

如何解決它,請給我建議。

等待您的答覆。

感謝

回答

相關問題