Occurs when the application has finished checking for updates in response to a CheckAndDownloadUpdateAsync method call.
Assembly: System.Windows (in System.Windows.dll)
In the event handler, the UpdateAvailable property is true if a newer version of the application was discovered and successfully downloaded. In this case, you can alert the user to restart the application in order to load the update.
If an application update is available, but uses a newer version of Silverlight that the user has not yet installed, the update will not be downloaded. This also occurs if an update changes the application to require elevated trust. In both cases, the UpdateAvailable property value is false, and the Error property value is an Exception instance. With a Silverlight version change, the exception is a PlatformNotSupportedException instance. With a security change, the exception is a SecurityException instance. When this happens, you can alert the user to open the application's host Web site, triggering your HTML-based Silverlight upgrade experience.
In general, you should check for updates only with the consent of the user, and notify the user when an update is available.
The following code example demonstrates how to use this event. This example is part of a larger example available in How to: Implement Offline Support for Out-of-Browser Applications.
Private WithEvents app As Application = Application.Current ... Private Sub updateButton_Click(ByVal sender As Object, _ ByVal e As RoutedEventArgs) app.CheckAndDownloadUpdateAsync() End Sub Private Sub App_CheckAndDownloadUpdateCompleted(ByVal sender As Object, _ ByVal e As CheckAndDownloadUpdateCompletedEventArgs) _ Handles app.CheckAndDownloadUpdateCompleted If e.UpdateAvailable Then MessageBox.Show("An application update has been downloaded. " & _ "Restart the application to run the new version.") ElseIf e.Error IsNot Nothing Then MessageBox.Show( _ "An application update is available, but an error has occurred.\n" & _ "This can happen, for example, when the update requires\n" & _ "a new version of Silverlight or requires elevated trust.\n" & _ "To install the update, visit the application home page.") LogErrorToServer(e.Error) Else MessageBox.Show("There is no update available.") End If End Sub Private Sub LogErrorToServer(ByRef ex As Exception) ' Not implemented. Logging the exact error to the server can help ' diagnose any problems that are not resolved by the user reinstalling ' the application from its home page. End Sub
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.