CoreWebView2DownloadOperation.StateChanged Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Event raised when the state of the download changes. Use @CoreWebView2DownloadOperation$.State to get the current state, and @CoreWebView2DownloadOperation$.InterruptReason to get the reason if the download is interrupted.
public event EventHandler<object> StateChanged;
member this.StateChanged : EventHandler<obj>
Public Custom Event StateChanged As EventHandler(Of Object)
Event Type
Examples
download.StateChanged += delegate (object sender, Object e)
{
switch (download.State)
{
case CoreWebView2DownloadState.InProgress:
break;
case CoreWebView2DownloadState.Interrupted:
// Here developer can take different actions based on `download.InterruptReason`.
// For example, show an error message to the end user.
break;
case CoreWebView2DownloadState.Completed:
break;
}
};
Remarks
Use State to get the current state, and InterruptReason to get the reason if the download is interrupted.