コード例 #1
0
 public GroupEditWindowViewModel(Action close, List <string> memberIds, AntSdkGroupInfo groupInfo)
 {
     IsCreateGroup     = false;
     Title             = "邀请加入讨论组";
     this.GroupInfo    = groupInfo;
     OriginalMemberIds = memberIds;
     this.close        = close;
     ContactInfoViewModel.StateImageClickEvent += StateImageClickEvent;
     ContactListViewModel = new ContactListViewModel(GlobalVariable.ContactInfoViewContainer.GroupEditWindowViewLeft, this);
     LeftPartViewModel    = ContactListViewModel;
     foreach (string memberId in memberIds)
     {
         AntSdkContact_User user = AntSdkService.AntSdkListContactsEntity.users.Find(c => c.userId == memberId);
         if (user == null)//离职人员信息
         {
             user          = new AntSdkContact_User();
             user.picture  = "pack://application:,,,/AntennaChat;Component/Images/离职人员.png";
             user.userName = "******";
             user.userId   = memberId;
         }
         ContactInfoViewModel myselfVM = new ContactInfoViewModel(user, GlobalVariable.ContactInfoViewContainer.GroupEditWindowViewRight);
         if (myselfVM == null)
         {
             continue;
         }
         myselfVM.StateImageVisibility = Visibility.Collapsed;
         GroupMemberList.Add(myselfVM);
     }
     MemberCount = string.Format("已选择{0}个联系人", _GroupMemberList.Count());
     //GroupName = groupInfo.groupName;
     GroupNameWateMark   = groupInfo.groupName;
     GroupNameIsReadOnly = true;
 }
コード例 #2
0
 public GroupEditWindowViewModel(Action close, List <string> memberIds)
 {
     OriginalMemberIds = memberIds;
     IsCreateGroup     = true;
     Title             = "创建讨论组";
     this.close        = close;
     ContactInfoViewModel.StateImageClickEvent += StateImageClickEvent;
     ContactListViewModel = new ContactListViewModel(GlobalVariable.ContactInfoViewContainer.GroupEditWindowViewLeft, this);
     LeftPartViewModel    = ContactListViewModel;
     foreach (string id in memberIds)
     {
         ContactInfoViewModel vm = new ContactInfoViewModel(AntSdkService.AntSdkListContactsEntity.users.Find(c => c.userId == id), GlobalVariable.ContactInfoViewContainer.GroupEditWindowViewRight);
         vm.StateImageVisibility = Visibility.Collapsed;
         GroupMemberList.Add(vm);
     }
     MemberCount = string.Format("已选择{0}个联系人", _GroupMemberList.Count());
 }
コード例 #3
0
 public MultiContactsSelectViewModel(List <string> memberIds)
 {
     OriginalMemberIds = memberIds;
     Title             = "选择联系人";
     ContactInfoViewModel.StateImageClickEvent += StateImageClickEvent;
     ContactListViewModel = new ContactListViewModel(GlobalVariable.ContactInfoViewContainer.MultiContactsSelectLeft, this);
     LeftPartViewModel    = ContactListViewModel;
     if (memberIds != null)
     {
         foreach (string id in memberIds)
         {
             ContactInfoViewModel vm = new ContactInfoViewModel(AntSdkService.AntSdkListContactsEntity.users.Find(c => c.userId == id), GlobalVariable.ContactInfoViewContainer.MultiContactsSelectRight);
             GroupMemberList.Add(vm);
         }
     }
     MemberCount = string.Format("已选择{0}个联系人", _GroupMemberList.Count());
 }