示例#1
0
 public MainAppViewModel(NavigationService navigationService)
 {
     _navigationService = navigationService;
     Messenger.Default.Register <NavigationMessage>(this, msg => ProcessNavigationMessage(msg));
     _navigationService.NavigateTo("bannerIDsearch");
     CurrentViewModel = _navigationService.CurrentViewModel;
 }
示例#2
0
 private void ProcessNavigationMessage(NavigationMessage msg)
 {
     if (msg.ViewModel == "cancel")
     {
         _navigationService.GoBack();
         CurrentViewModel = _navigationService.CurrentViewModel;
     }
     else if (msg.ViewModel == "exit")
     {
         Messenger.Default.Send <CloseMessage>(new CloseMessage());
     }
     else
     {
         _navigationService.NavigateTo(msg.ViewModel);
         CurrentViewModel = _navigationService.CurrentViewModel;
     }
 }