Please login to access all of the features of the Community Site.

ReplacePage

M v1.0

This command replaces the current page with a new page. This differs from the PushPage command. Using the ReplacePage command, if the user then taps the back button then they will be taken back to the page they were on before the page that called the ReplacePage command.

If the CommandParameter is a string, then it is expected to contain a page's GUID value and, optionally, a set of query string parameters. The first parameter is separated by a ? and any additional parameters are separated by &. Since these query string parameters are inside an XML document, you must escape them (for example, your & must become &).

If you are using data binding you can also bind the CommandParameter to a true GUID value, in which case it must be the GUID of a valid page.

Finally, if you need advanced parameter usage you can use a ReplacePageParameters object.

Properties

PropertyTypeDescription
PageGuidGuidThe Guid identifier of the page to be used to replace the current page.
ParametersList<Parameter>  Any additional query string parameters to be passed to the page.
WaitForReadyboolWaits until the page is loaded before displaying it. (Defaults to false.)  
<Button Text="Replace Page"
    Command="{Binding ReplacePage}"
    CommandParameter="e4d80e57-da60-4822-bc22-c071f02958e8" />
<Button Text="Replace Page"
    Command="{Binding ReplacePage}"
    CommandParameter="{Rock:ReplacePageParameters PageGuid='e4d80e57-da60-4822-bc22-c071f02958e8', WaitForReady='True'}" />
<Button Text="Replace Page"
    Command="{Binding ReplacePage}">
    <Button.CommandParameter>
        <Rock:ReplacePageParameters PageGuid="e4d80e57-da60-4822-bc22-c071f02958e8">
            <Rock:Parameter Name="GroupId"
                Value="18" />
            <Rock:Parameter Name="Mode"
                Value="Edit" />
        </Rock:ReplacePageParameters>
    </Button.CommandParameter>
</Button>