Geeth
Geeth

Reputation: 5343

WPF - RelativeSource Binding Problem

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.

Upvotes: 2

Views: 2020

Answers (1)

Arcturus
Arcturus

Reputation: 27055

Add Mode=FindAncestor to the RelativeSource Binding :)

{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type NavigationWindow}}, Path=BackStack}

Upvotes: 4

Related Questions