Export (0) Print
Expand All

NavigationService.NavigationProgress Event

Occurs periodically during a download to provide navigation progress information.

Namespace: System.Windows.Navigation
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public event NavigationProgressEventHandler NavigationProgress
/** @event */
public void add_NavigationProgress (NavigationProgressEventHandler value)

/** @event */
public void remove_NavigationProgress (NavigationProgressEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
You cannot use this event in XAML.

NavigationProgress is passed a NavigationProgressEventArgs which exposes the following progress information:

  • Number of bytes downloaded so far (BytesRead).

  • Number of total bytes to download (MaxBytes).

NavigationProgress is fired once for every 1024 bytes of content downloaded, and once more if the number of remaining bytes is ever less than 1024 bytes. For this reason, handling NavigationProgress provides a useful way to track and display the progress of a current download.

NavigationProgress won't be raised in some cases, such as when the same piece of content is navigated to, or when a content fragment is navigated to on content that is currently loaded (ie the value of the Content property).

NoteNote:

When NavigationService raises NavigationProgress, it also raises Application.NavigationProgress event on the Application object.

The following example shows how to handle NavigationProgress.

void NavigationService_NavigationProgress(object sender, NavigationProgressEventArgs e)
{
    string msg = string.Format("{0} of {1} bytes retrieved.", e.BytesRead, e.MaxBytes);
    this.progressStatusBarItem.Content = msg;
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft