Export (0) Print
Expand All

PageFunction.Return Event

Occurs when a called PageFunction returns, and can only be handled by the calling page.

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

public event ReturnEventHandler<T> Return
/** @event */
public void add_Return (ReturnEventHandler<T> value)

/** @event */
public void remove_Return (ReturnEventHandler<T> value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
<object Return="ReturnEventHandler<T>" .../>

A calling page detects when a called PageFunction returns by handling Return. Additionally, the calling page can retrieve the PageFunction return value from the Result property of the ReturnEventArgs which is passed to the event handler.

The following example shows how to handle the Return event.

void callPageFunctionButton_Click(object sender, RoutedEventArgs e)
{
    // Create page function object
    GetStringPageFunction pageFunction = new GetStringPageFunction();

    // Detect when page function returns
    pageFunction.Return += new ReturnEventHandler<String>(PageFunction_Return);

    // Call page function
    this.NavigationService.Navigate(pageFunction);
}

void PageFunction_Return(object sender, ReturnEventArgs<String> e)
{
    // Retrieve page function return value
    string returnValue = e.Result;
}

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