0

FlowDocumentReader doesn't have a GoToPage method, but it supports NavigationCommands.GoToPage RoutedUICommand.

How do I send NavigationCommands.GoToPage with parameter (for example: 1) to my FlowDocumentReader from within my code (not using xaml)?

Thanks, Yariv

Edited: Thanks! But though I can send the command with your help, I don't get the expected results. This is the code (and I tried to use FirstPage instead of PreviousPage too):

if (NavigationCommands.PreviousPage.CanExecute(null, this) == true)
{
    NavigationCommands.PreviousPage.Execute(null, this);
}

Even though the if statement is true and the inner code is being executed, the FlowDocumentReader stays in the last page...

Yariv
  • 21
  • 5

1 Answers1

0
FlowDocumentReader flowDoc;
...
NavigationCommands.GoToPage.Execute("my parameter", flowDoc);
John Bowen
  • 24,213
  • 4
  • 58
  • 56
  • Thanks! But though I can send the command with your help, I don't get the expected results. This is the code (and I tried to use FirstPage instead of PreviousPage too): if (NavigationCommands.PreviousPage.CanExecute(null, this) == true) { NavigationCommands.PreviousPage.Execute(null, this); } Even though the if statement is true and the inner code is being executed, the FlowDocumentReader stays in the last page... – Yariv Sep 17 '10 at 19:50