PageFunction<T>.OnReturn(ReturnEventArgs<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A PageFunction<T> calls OnReturn(ReturnEventArgs<T>) to return to the caller, passing a return value via a ReturnEventArgs<T> object.
protected:
virtual void OnReturn(System::Windows::Navigation::ReturnEventArgs<T> ^ e);
protected virtual void OnReturn (System.Windows.Navigation.ReturnEventArgs<T> e);
abstract member OnReturn : System.Windows.Navigation.ReturnEventArgs<'T> -> unit
override this.OnReturn : System.Windows.Navigation.ReturnEventArgs<'T> -> unit
Protected Overridable Sub OnReturn (e As ReturnEventArgs(Of T))
Parameters
A ReturnEventArgs<T> object that contains the PageFunction<T> return value (Result).
Examples
The following example shows how to call OnReturn.
void doneButton_Click(object sender, RoutedEventArgs e)
{
// Complete the page function and return data of type T
OnReturn(new ReturnEventArgs<String>(this.pageFunctionData.Text));
}
Private Sub doneButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Complete the page function and return data of type T
OnReturn(New ReturnEventArgs(Of String)(Me.pageFunctionData.Text))
End Sub
Remarks
OnReturn is called by a PageFunction<T> to initiate a navigation to the calling page.
This causes the Return event to be raised, in order for the calling page to:
Detect when the PageFunction<T> has returned.
Retrieve the return value from the PageFunction<T>.