Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
PageFunction<(Of <(T>)>) Class

Represents 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)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Visual Basic (Declaration)
Public Class PageFunction(Of T) _
    Inherits PageFunctionBase
Visual Basic (Usage)
Dim instance As PageFunction(Of T)
C#
public class PageFunction<T> : PageFunctionBase
Visual C++
generic<typename T>
public ref class PageFunction : public PageFunctionBase
JScript
JScript does not support generic types or methods.
XAML Object Element Usage
<PageFunction x:TypeArguments="T">
  Content
</PageFunction>

Type Parameters

T

The type of value that the PageFunction<(Of <(T>)>) returns to a caller.

PageFunction<(Of <(T>)>) 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<(Of <(T>)>) 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<(Of <(T>)>) 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 Return event.

  • To return a value, the page function creates an instance of the ReturnEventArgs<(Of <(T>)>) class and sets the Result property with the return value. The calling page can retrieve this value from the ReturnEventArgs<(Of <(T>)>) object that is passed to the Return event handler.

By default, a PageFunction<(Of <(T>)>) 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 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<(Of <(T>)>) enables the development of wizards, which is shown in Wizard Sample.

System..::.Object
  System.Windows.Threading..::.DispatcherObject
    System.Windows..::.DependencyObject
      System.Windows.Media..::.Visual
        System.Windows..::.UIElement
          System.Windows..::.FrameworkElement
            System.Windows.Controls..::.Page
              System.Windows.Navigation..::.PageFunctionBase
                System.Windows.Navigation..::.PageFunction<(Of <(T>)>)
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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker