问题描述:

In my windows phone 8 application I want to preserve state of my application, using this link

And seen in the topic of Modifying the Page Class

I modify my MainPage class constructor and add this line:

(Application.Current as ExecutionModelApplication.App).ApplicationDataObjectChanged +=

new EventHandler(MainPage_ApplicationDataObjectChanged);

To my MainPage class constructor like 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);

}

But i getting error below at ExecutionModelApplication :

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

How do I resolve it, Kindly suggest me.

Waiting for your reply.

Thanks

网友答案:

"ExecutionModelApplication" is the name of the application class in that example in your link. You need to substitute it with the name of your own application class.

See:

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/d5a8bf79-e968-4ff7-8b2d-384968d66a06/wher-is-executionmodelapplication-type-defined?forum=wpdevelop

相关阅读:
Top