Thursday, May 21, 2009

Whether Silverlight 3 application is running online or not

Just check the below mentioned property to know the network status of Silverlight application.We can do operations according to that.
Application.Current.ExecutionState

There are 5 possible states which are defined in System.Windows.ExecutionStates

// Summary:
// Defines constants that indicate the state of an application that can run
// offline.
public enum ExecutionStates
{
// Summary:
// The application is running within its host Web page.
RunningOnline = 0,
//
// Summary:
// The application is in the process of detaching from its host Web page.
Detaching = 1,
//
// Summary:
// The application is running in offline mode, detached from its host Web page.
Detached = 2,
//
// Summary:
// The application is running in offline mode, but a newer version of the application
// has been downloaded and will be used the next time the application is launched.
DetachedUpdatesAvailable = 3,
//
// Summary:
// The application could not be detached from its host Web page.
DetachFailed = 4,
}

No comments: