gpt4 book ai didi

wpf - 如何更改 WPF 框架中导航栏的属性?

转载 作者:行者123 更新时间:2023-12-04 16:39:52 26 4
gpt4 key购买 nike

我正在开发一个基于页面的 WPF 应用程序,我想更改框架中导航栏的大小。我设置了 NavigationUIVisibility="Visible"以查看导航栏,现在如何更改导航栏上的属性,如它的大小?

谢谢,
罗伊

最佳答案

导航栏很难改变。我建议您自己创建。
创建您自己的按钮,然后使用

myFrame.NavigationService.GoBack()
myFrame.NavigationService.GoForward()

例子:

Private Sub PreviousPageCommand_Executed(ByVal sender As Object, _
ByVal e As ExecutedRoutedEventArgs)
MainFrame.NavigationService.GoBack()
End Sub

Private Sub PreviousPageCommand_CanExecute(ByVal sender As Object, _
ByVal e As CanExecuteRoutedEventArgs)
If Not MainFrame Is Nothing Then
e.CanExecute = MainFrame.NavigationService.CanGoBack
Else
e.CanExecute = False
End If
End Sub

Private Sub NextPageCommand_Executed(ByVal sender As Object, _
ByVal e As ExecutedRoutedEventArgs)
MainFrame.NavigationService.GoForward()
End Sub

Private Sub NextPageCommand_CanExecute(ByVal sender As Object, _
ByVal e As CanExecuteRoutedEventArgs)
If Not MainFrame Is Nothing Then
e.CanExecute = MainFrame.NavigationService.CanGoForward
Else
e.CanExecute = False
End If
End Sub

关于wpf - 如何更改 WPF 框架中导航栏的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/846398/

26 4 0