Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i tried handling Unloaded event for the main page (user control) and the image control inside it. neither is called when i close the page. so i don't know when the event is raised.
i need to do something before the page is closed. that's closing the session i've opened when the page is loaded.
then, another question, if the user hit F5 and refresh the page, does Loaded event get called again and a new session is opened without the previous one is closed?
it sounds i'm a newbie in Silverlight. indeed, it's the case :)
appreciating ur replies
Posted

public MainPage()
{
InitializeComponent();
App.Current.MainWindow.Closing += new EventHandler<System.ComponentModel.ClosingEventArgs>(MainWindow_Closing);
}

void MainWindow_Closing(object sender, System.ComponentModel.ClosingEventArgs e)
{

// Do all stuff here ....

}

Thankz .... :)
 
Share this answer
 
Ya the loaded event ( its just the constructor of the xaml file is called again )

and the aspx page load event is fired . Sessions produced in silverlight are cleared ..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900