private void OnSave(object arg) { if (string.IsNullOrWhiteSpace(GroupName)) { var localizationService = ServiceLocator.Current.GetInstance <ILocalizationService>(); var str = localizationService.Translate("usermanagment_empty_group_name_warning_label"); MessageBox.Show(str); return; } var groupService = ServiceLocator.Current.GetInstance <IGroupService>(); var newGroup = new Group.Group() { GroupId = 0, Ident = 0, IsDefaultGroup = IsDefault, Name = GroupName }; groupService.Save(newGroup); NewGroup = new GroupViewModel(newGroup); }
/// <summary> /// Constructor for the view model /// </summary> /// <param name="group">Current group</param> public GroupDetailsViewModel(GroupViewModel group) { Group = group; NewGroupName = Group.Name; }