private void ViewSelectedChange(MenuViewModelBase menuView) { // DO NOT mess up below steps. // step #0: skip unselected menu event when switch menu of different menu group if (menuView == null) { return; } // step #1: configure searcher var searcher = ServiceLocator.Current.GetInstance <IViewModelSearcher>(); searcher.ResetSearchText(); // step #2: configure paginator var paginator = ServiceLocator.Current.GetInstance <IViewModelPaginator>(); paginator.ResetDisplayPage(); // if query database failure, prompt if (SelectView != null && SelectView.QueryDatabaseFailure()) { ServiceLocator.Current.GetInstance <IViewModelErrorWindow>().ErrorWindow( this, TranslationService.Translate("View_Messagebox_Text_QueryDatabaseFailure").ToString()); } }