This documentation is archived and is not being maintained.

PageFunction Generic Class

A special type of page that allows you to treat navigation to a page in a similar fashion to calling a method.

Namespace: System.Windows.Navigation
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public class PageFunction<T> : PageFunctionBase
J# supports the use of generic types and methods, but not the declaration of new ones.
JScript does not support generic types and methods.
<PageFunction x:TypeArguments="T">

Type Parameters


The type of value that the PageFunction returns to a caller.

PageFunction essentially allows you to treat a page navigation like a function call, in which a page navigates to (calls) a page function.

To enable function call semantics, PageFunction provides the following capabilities:

  • When the page function has finished processing, the page function code calls OnReturn to return to the calling page.

  • OnReturn accepts a ReturnEventArgs parameter, which can be used to return a value by settings the Result property. Otherwise, null can be passed to OnReturn to signify no value is returned

  • To detect when a page function has returned, the calling page can handle the page function's PageFunction. Return event.

  • To return a value, the page function passes creates an instance of ReturnEventArgs class and sets its object whose Result property can be set with the return value. The calling page can retrieve this value from the ReturnEventArgs object that is passed to the Return event handler.

By default, a pf is retained in navigation history after it returns. To ensure that it is not retained in navigation history, its RemoveFromJournal property should be set to true.

See Create a Simple PageFunction to create a simple PageFunction.

See Structured Navigation Overview for details on how to use page functions.

See Navigation Topologies Overview for information on complex navigation structures that benefit from page functions.

PageFunction enables the development of wizards, which is shown in Wizard Sample.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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