コード例 #1
0
        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);
        }
コード例 #2
0
 /// <summary>
 /// Constructor for the view model
 /// </summary>
 /// <param name="group">Current group</param>
 public GroupDetailsViewModel(GroupViewModel group)
 {
     Group        = group;
     NewGroupName = Group.Name;
 }