Created
May 24, 2011 15:04
-
-
Save TravisTheTechie/988878 to your computer and use it in GitHub Desktop.
WP7 App Using Cashbox for Mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DocumentSession Session { get; private set; } | |
// Code to execute when the application is launching (eg, from Start) | |
// This code will not execute when the application is reactivated | |
private void Application_Launching(object sender, LaunchingEventArgs e) | |
{ | |
Session = DocumentSessionFactory.Create(FileName); | |
} | |
// Code to execute when the application is activated (brought to foreground) | |
// This code will not execute when the application is first launched | |
private void Application_Activated(object sender, ActivatedEventArgs e) | |
{ | |
Session = DocumentSessionFactory.Create(FileName); | |
} | |
// Code to execute when the application is deactivated (sent to background) | |
// This code will not execute when the application is closing | |
private void Application_Deactivated(object sender, DeactivatedEventArgs e) | |
{ | |
Session.Dispose(); | |
} | |
// Code to execute when the application is closing (eg, user hit Back) | |
// This code will not execute when the application is deactivated | |
private void Application_Closing(object sender, ClosingEventArgs e) | |
{ | |
Session.Dispose(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Session.Store("key", object); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment