Exemple #1
0
        public UserViewModel(MainViewModel mainViewModel, Model.UserInfo user)
        {
            this.mainViewModel = mainViewModel;

            userName = user.UserName;
            accountType = user.AccountType;
            profileImage = user.ProfileImage;
            signUpDate = user.SignUpDate;

            Sets = new ObservableCollection<SetViewModel>(from si in user.Sets select new SetViewModel(mainViewModel, si));
            Groups = new ObservableCollection<GroupViewModel>(from gi in user.Groups select new GroupViewModel(mainViewModel, gi));
        }
        public GroupViewModel(MainViewModel mainViewModel, GroupInfo group)
        {
            this.mainViewModel = mainViewModel;

            ID = group.ID;
            Name = group.Name;
            Description = group.Description;
            Created = group.Created;
            IsPublic = group.IsPublic;
            HasPassword = group.HasPassword;
            HasAccess = group.HasAccess;
            HasDiscussion = group.HasDiscussion;
            MemberAddSets = group.MemberAddSets;

            Sets = @group.Sets != null
                ? new ObservableCollection<SetViewModel>(from si in @group.Sets select mainViewModel.GetSet(si.ID, false))
                : new ObservableCollection<SetViewModel>();
        }