Return Event
Collapse the table of content
Expand the table of content

PageFunction<T>.Return Event

 

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

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

public event ReturnEventHandler<T> Return

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

<object Return="ReturnEventHandler"/>

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;
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft