Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change properties on the Navigation Bar in a WPF Frame?

Tags:

wpf

I'm working on a page based WPF application, and I want to change the size of the navigation bar in the frame. I set NavigationUIVisibility="Visible" in order to see the navigation bar, now how do I change properties on the navigation bar like it's size?

Thanks,
Roy

like image 339
LPCRoy Avatar asked Oct 20 '25 13:10

LPCRoy


1 Answers

The Navigation Bar is hard to change. I recommend you to create you own.
Create you own buttons and then use

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

Example:

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
like image 170
Eduardo Molteni Avatar answered Oct 23 '25 07:10

Eduardo Molteni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!