/// <summary> /// Event handler for when the environment has changed. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">An object that contains the name of the new configuration.</param> public void EnvironmentChangedEventHandler(object sender, PubSubEventArgs <string> args) { this.logger.Debug("Handling environment changed received event."); this.query = new RestQuery(ProxyConfigHelper.GetConfig(args.Item), this.logger); this.SearchCommand.Execute(this.Model); }
private void EnvironmentChangedEventHandler(object sender, PubSubEventArgs <string> e) { this.logger.Debug("Handling environment changed received event."); this.restQuery = new RestQuery(ProxyConfigHelper.GetConfig(e.Item), this.logger); this.Model.ResultCollection = new ObservableCollection <OrganizationModel>(); this.Model.EmptyMessageVisibility = false; this.Model.SelectAllChecked = false; }
/// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); // Logging SimpleIoc.Default.Register(() => LogManager.GetLogger(this.GetType())); // ILog log4net.Config.XmlConfigurator.Configure(); // AutoMapper SimpleIoc.Default.Register(AutoMapperHelper.RunCreateMaps); // IMapper // View models SimpleIoc.Default.Register <MainViewModel>(); SimpleIoc.Default.Register <SearchOrganizationInformationViewModel>(); SimpleIoc.Default.Register <SearchResultViewModel>(); SimpleIoc.Default.Register <TopViewModel>(); SimpleIoc.Default.Register <FooterViewModel>(); // Proxy SimpleIoc.Default.Register <IRestQuery>(() => new RestQuery(ProxyConfigHelper.GetConfig(), ServiceLocator.Current.GetInstance <ILog>())); }