"The navigation controller for this service cannot be located."

1 reply. Last post: May 4, 2014 11:16 AM by Nicholas Lie
Tags :
  • (None)
andrew aMember

Hi,

I hope somebody has seen this error and has an idea or where the issue might be.

I am trying to use the NavigationService.Navigate from isde a view model and it crashes with this error message:

"The navigation controller for this service cannot be located."

The RootViewModel is a MultiPageViewModel.


Any hint is greatly appreciated.


All Replies

Hi Andrew,

Thanks for the question. The error is because, exactly, that you are using a MultiPageViewModel. If you would kindly take a look at the MVVMSamples shipped with Crosslight, may I redirect your attention to the EventPublisherViewModel which contains the following code.

private void ExecuteSendMessage(object parameter)
{
    ((IMultiPageViewModel)this.ParentViewModel).SelectedIndex = 1;
    EventAggregator.Default.Publish<DelegateEvent<string>, string>(this.Message);
}

Instead of invoking the navigation service here, you need to set the SelectedIndex to move from one tab to another. Feel free to ask if you have any further questions. Thanks.

 
nicholas@intersoftsolutions.com Intersoft Solutions BizOne Office Building, 2nd floor Boulevard Artha Gading Street A6B, 28 14240 – North Jakarta, Indonesia Phone: +(6221) 45873997; +(6221) 45873998 Fax +(6221) 45873998 ext 104
All times are GMT -5. The time now is 2:05 PM.
Previous Next