コード例 #1
0
        public void Save()
        {
            //TODO save Changes

            foreach (var userDocument in docs)
            {
                var doc = SelectedUser.UserDocuments.FirstOrDefault(d => d.Document == userDocument.Document);
                if (doc != null)
                {
                    doc.IsAvailable = userDocument.IsAvailable;
                }
                else if (userDocument.IsAvailable)
                {
                    SelectedUser.UserDocuments.Add(userDocument);
                }
            }
            Membership.AddOrUpdate(SelectedUser);

            SaveChanges();
            IsModalVisible = false;
            RefreshItemSource();
        }