Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Get the Return Value of a Page Function

This example shows how to get the result that is returned by a page function.

To get the result that is returned from a page function, you need to handle Return of the page function you are calling.

<Page x:Class="UsingPageFunctionsSample.CallingPage"
    <Hyperlink Name="callPageFunctionHyperlink" Click="callPageFunctionHyperlink_Click">Call Page Function</Hyperlink>

void callPageFunctionAndReturnHyperlink_Click(object sender, RoutedEventArgs e)
    // Call a page function and hook up page function's return event to get result
    GetStringPageFunction pageFunction = new GetStringPageFunction();
    pageFunction.Return += new ReturnEventHandler<String>(GetStringPageFunction_Returned);
void GetStringPageFunction_Returned(object sender, ReturnEventArgs<String> e)
    // Get the result, if a result was passed.
    if (e.Result != null)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.