void OnAdd() { var roleDetailsViewModel = new RoleDetailsViewModel(); if (DialogService.ShowModalWindow(roleDetailsViewModel)) { FiresecManager.SecurityConfiguration.UserRoles.Add(roleDetailsViewModel.Role); var roleViewModel = new RoleViewModel(roleDetailsViewModel.Role); Roles.Add(roleViewModel); SelectedRole = roleViewModel; ServiceFactory.SaveService.SecurityChanged = true; } }
public void Initialize() { Roles = new ObservableCollection<RoleViewModel>(); foreach (var role in FiresecManager.SecurityConfiguration.UserRoles) Roles.Add(new RoleViewModel(role)); SelectedRole = Roles.FirstOrDefault(); }