Force silverlight application to work offline only

If you want to create an application that supports offline use only, you can use code like this in the Startup event handler:

private void Application_Startup(object sender, StartupEventArgs e) 
{ 
    if (Application.Current.IsRunningOutOfBrowser) 
    { 
        // Show the full user interface. 
        this. RootVisual = new MainPage(); 
    } 
    else 
    { 
        // Show a window with an installation message and an Install button. 
        this. RootVisual = new InstallPage() ; 
    } 
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.