public EmailDetailsViewModel()
		{
			SelectZonesCommand = new RelayCommand(OnSelectZonesCommand);
			StateTypes = new ObservableCollection<StateTypeViewModel>();
			foreach (StateType stateType in Enum.GetValues(typeof(StateType)))
			{
				StateTypes.Add(new StateTypeViewModel(stateType));
			}
			Title = "Создать получателя";
			EmailViewModel = new EmailViewModel();
		}
		public EmailDetailsViewModel(Email email)
		{
			SelectZonesCommand = new RelayCommand(OnSelectZonesCommand);
			StateTypes = new ObservableCollection<StateTypeViewModel>();
			foreach (StateType stateType in Enum.GetValues(typeof(StateType)))
			{
				StateTypes.Add(new StateTypeViewModel(stateType));
			}
			Title = "Редактировать получателя";
			EmailViewModel = new EmailViewModel(email);
			StateTypes.Where(
				eventViewModel => email.States.Any(
					x => x == eventViewModel.StateType)).All(x => x.IsChecked = true);
		}
		public void Initialize()
		{
			Emails = new ObservableCollection<EmailViewModel>();

			if (FiresecManager.SystemConfiguration.EmailData.Emails == null ||
				FiresecManager.SystemConfiguration.EmailData.Emails.Count == 0)
			{
				FiresecManager.SystemConfiguration.EmailData.Emails = new List<Email>();
				AddSampleEmail();
			}

			foreach (var email in FiresecManager.SystemConfiguration.EmailData.Emails)
			{
				var emailViewModel = new EmailViewModel(email);
				Emails.Add(emailViewModel);
			}

			SelectedEmail = Emails.FirstOrDefault();
		}
		private void OnAdd()
		{
			var emailDetailsViewModel = new EmailDetailsViewModel();
			if (DialogService.ShowModalWindow(emailDetailsViewModel))
			{
				FiresecManager.SystemConfiguration.EmailData.Emails.Add(emailDetailsViewModel.EmailViewModel.Email);
				var emailViewModel = new EmailViewModel(emailDetailsViewModel.EmailViewModel.Email);
				Emails.Add(emailViewModel);
				SelectedEmail = emailViewModel;
				ServiceFactory.SaveService.EmailsChanged = true;
			}
		}