Files
docs-desktop/dotnet-desktop-guide/framework/wpf/app-development/how-to-call-a-page-function.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.9 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Call a Page Function 03/30/2017
csharp
vb
calling page functions [WPF]
page functions [WPF], calling
functions [WPF], calling
a4808397-c6d5-406a-83e0-0091f0c15ae4

How to: Call a Page Function

This example shows how to call a page function from a [!INCLUDETLA#tla_xaml] page.

Example

You can navigate to a page function using a uniform resource identifier (URI), just as you can when you navigate to a page. This is shown in the following example.

[!code-csharpHOWTOPageFunctionSnippets#NavigateToAPageFunctionLikeAPageCODEBEHIND] [!code-vbHOWTOPageFunctionSnippets#NavigateToAPageFunctionLikeAPageCODEBEHIND]

If you need to pass data to the page function, you can create an instance of it and pass the data by setting a property. Or, as the following example shows, you can pass the data using a non-parameterless constructor.

[!code-xamlHOWTOPageFunctionSnippets#CallAPageFunctionXAML]

[!code-csharpHOWTOPageFunctionSnippets#CallAPageFunctionCODEBEHIND] [!code-vbHOWTOPageFunctionSnippets#CallAPageFunctionCODEBEHIND]

See also