2

I am trying to create a back button. So i am binding the navigationwindows backstack.

Code:

 <Hyperlink Name="back" NavigateUri="{Binding RelativeSource={RelativeSource AncestorType={x:Type NavigationWindow}}, Path=BackStack}">

Problem:

  1. Error: Mode must be specified for RelativeSource.

Update:

It is not navigation to the previous page.

Geetha.

1 Answer 1

4

Add Mode=FindAncestor to the RelativeSource Binding :)

{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type NavigationWindow}}, Path=BackStack}
Sign up to request clarification or add additional context in comments.

2 Comments

Hi, Thank you for the reply. Error has gone but it is not working. Do you have any idea on this?
BackStack is a list, and NavigateUri expects a Uri :) I don't think Hyperlink will be the answer you are seeking.. Check out Buttons and events. Also, check out this link: msdn.microsoft.com/en-us/library/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.