none
How to enable a NavigationCommands.gotopage command? RRS feed

  • Question

  • I have a Menu, which resides in a UserControl on a Page in WPF.  The menu items are supposed to navigate a frame on the container control.  It works if I use Hyperlinks instead of MenuItems, but I want to use menu items and the built in commands.

    I have this....

    <MenuItem Header="Page 1" Command="NavigationCommands.GoToPage" CommandParameter="/Setup/SuppliersPage.xaml" CommandTarget="{Binding ElementName=frmContent}" /> 
     

    But the menuitem is always disabled.  How do I tell it to enable the menu item without implementing a custom commandbinding?


    Wednesday, September 10, 2008 9:10 AM

Answers

  • Based on my research, only DocumentViewer and FlowDocumentPageViewer support NavigationCommands.GoToPage natively, for other controls like Frame, you need to hook up the CommandBindings and CanExecute and Executed command handlers.

    Hope this clears things up a little bit.
    • Marked as answer by Marco Zhou Tuesday, September 16, 2008 9:52 AM
    Friday, September 12, 2008 8:44 AM