private void SetDefaults(UserSettings settings) { SelectedEnvironment = EnvironmentList?.FirstOrDefault(env => env == settings.Environment); SelectedAgentLocation = AgentLocationList.FirstOrDefault(loc => loc.AgentStateCode == settings.AgentLocation) ?? AgentLocationList.First(); SelectedAgent = AgentList.FirstOrDefault(agent => agent.AgentId == settings.AgentId) ?? AgentList.First(); SelectedAgentPos = AgentPosList.FirstOrDefault(agentPos => agentPos.AgentSequence == settings.AgentPosId) ?? AgentPosList.First(); }
private void AgentManagementChange(AgentManagementChangedEvent obj) { LoadAgents(); RaisePropertyChanged(nameof(EnvironmentList)); RaisePropertyChanged(nameof(AgentLocationList)); SelectedAgentLocation = AgentLocationList.First(); RaisePropertyChanged(nameof(SelectedAgentLocation)); RaisePropertyChanged(nameof(AgentList)); SelectedAgent = AgentList.First(); RaisePropertyChanged(nameof(SelectedAgent)); RaisePropertyChanged(nameof(AgentPosList)); }