Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Application.InstallState Property

Silverlight

Gets the current out-of-browser installation state of the application.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Public ReadOnly Property InstallState As InstallState

Property Value

Type: System.Windows.InstallState
The out-of-browser installation state of the application.

Use this property to determine whether a user has installed the application for use outside the browser. To determine whether the current application instance is running outside the browser, use the IsRunningOutOfBrowser property.

The following code example demonstrates how to use this property. This example is part of a larger example available in How to: Implement Offline Support for Out-of-Browser Applications.


Private Sub App_InstallStateChanged(ByVal sender As Object, _
    ByVal e As EventArgs) Handles app.InstallStateChanged

    UpdateUI()

End Sub

Private Sub UpdateUI()

    UpdateNetworkIndicator()

    installButton.Visibility = If(
        app.InstallState = InstallState.NotInstalled,
        Visibility.Visible, Visibility.Collapsed)

    updateButton.Visibility = If(app.IsRunningOutOfBrowser,
        Visibility.Visible, Visibility.Collapsed)

    isRunningOutOfBrowserTextBlock.Text = _
        app.IsRunningOutOfBrowser.ToString()

    installStateTextBlock.Text = app.InstallState.ToString()

End Sub

Private Sub UpdateNetworkIndicator()

    If app.IsRunningOutOfBrowser Then
        networkIndicator.Visibility = Visibility.Visible
    Else
        networkIndicator.Visibility = Visibility.Collapsed
    End If



    Dim online As Boolean = NetworkInterface.GetIsNetworkAvailable()


    If online Then
        networkIndicator.Text = "ONLINE" 

        updateButton.Visibility = Visibility.Visible
    Else
        networkIndicator.Text = "OFFLINE"
        updateButton.Visibility = Visibility.Collapsed
    End If

End Sub


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft