WPF 自定义导航按钮并从另一个页面调用一个页面

发布于 2024-10-08 03:30:15 字数 411 浏览 0 评论 0原文

我有一个窗口,其中包含一个框架,该框架引用一个带有按钮的“主页”页面。单击按钮时,我希望根据按下的按钮显示另一个页面。我尝试使用

NavigationService.Navigate('mynextpage.xaml')

并且有效,但是我想使用自定义的导航面板。 调用

this.ShowsNavigationUI = false;

我在“主页”页面上 但该栏仍然显示。有办法完成我想做的事情吗?

我的带有框架的页面是一个窗口,所以我不知道如何禁用导航栏,我猜它来自那里。

进一步测试表明 ShowsNavigationUI 属性为 false,但一旦有第二个页面可供访问(显示历史记录中的“主页”页面),导航栏就会在父窗口中显示自身

。TIA

I have a window which contains a Frame which references a 'home' page that has buttons on it. When a button is clicked I want another page to show depending on which button was pressed. I attempted to use

NavigationService.Navigate('mynextpage.xaml')

and that works however, I want to use a customized navigation panel. I call

this.ShowsNavigationUI = false;

on my 'home' page but the bar still shows. Is there a way to accomplish what I am trying to do?

My page with the frame is a window so I do not know how to disable the Navigation bar there where I guess it is coming from.

Further testing shows that the ShowsNavigationUI property is false yet the nav bar shows itself in the parent window once there is a second page to go to (showing the 'home' page in the history.

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

摇划花蜜的午后 2024-10-15 03:30:15

如果我理解正确的话,你想隐藏框架的导航镶边,这样做设置

<Frame Name="hostFrame" NavigationUIVisibility="Hidden"/>

if i understand you correctly you want to hide the navigation chrome of a Frame, to do so set

<Frame Name="hostFrame" NavigationUIVisibility="Hidden"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文