/// <summary> /// Initializes a new instance of the <see cref="FooterViewModel"/> class. /// ViewModel for Footer view /// </summary> public FooterViewModel() { this.ChangeEnvironmentCommand = new RelayCommand(this.ChangeEnvironmentHandler); this.EnvironmentNames = new ObservableCollection <string>(EnvironmentConfigurationManager.EnvironmentConfigurations.Select(c => c.Name).ToList()); this.SelectedEnvironment = EnvironmentConfigurationManager.ActiveEnvironmentConfiguration.Name; PubSub <string> .AddEvent(EventNames.EnvironmentChangedEvent, this.EnvironmentChangedEventHandler); }
/// <summary> /// Initializes a new instance of the SearchOrganizationInformationViewModel class. /// </summary> /// <param name="logger">The logger to be used by the instance.</param> /// <param name="mapper">The AutoMapper instance to use by the view model.</param> /// <param name="query">The query proxy to use in the actual searches.</param> public SearchOrganizationInformationViewModel(ILog logger, IMapper mapper, IRestQuery query) { this.logger = logger; this.mapper = mapper; this.query = query; this.Model = new SearchOrganizationInformationModel(); this.SearchCommand = new RelayCommand <SearchOrganizationInformationModel>(this.SearchCommandHandler); PubSub <ObservableCollection <OrganizationModel> > .AddEvent(EventNames.SearchResultReceivedEvent, this.SearchResultReceivedEventHandler); PubSub <bool> .AddEvent(EventNames.SearchStartedEvent, this.SearchStartedEventHandler); PubSub <string> .RegisterEvent(EventNames.EnvironmentChangedEvent, this.EnvironmentChangedEventHandler); }
public MyToggleButtonViewModel() { PubSub <object> .AddEvent("TBPresses", TogglePressed); }