Redigera

Dela via


PageFunction<T>.OnReturn(ReturnEventArgs<T>) Method

Definition

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

e
ReturnEventArgs<T>

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:

Applies to

See also