开发者

WPF - RelativeSource Binding Problem

开发者 https://www.devze.com 2023-01-05 10:19 出处:网络
I am trying to create a back button. So i am binding the navigationwindows backstack. Code: <Hyperlink Name=\"back\" NavigateUri=\"{开发者_运维百科Binding RelativeSource={RelativeSource Ancestor

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.


Add Mode=FindAncestor to the RelativeSource Binding :)

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

精彩评论

暂无评论...
验证码 换一张
取 消