示例#1
0
        internal void RemoveCats(List <string> requireRemove)
        {
            foreach (var item in Posts)
            {
                item.Cats = item.Cats.Where(s => !requireRemove.Contains(s)).ToObservableCollection();
            }

            OnPostsUpdate?.Invoke();
        }
示例#2
0
        internal bool RemoveRelatedPosts(string value)
        {
            int willRemovedPostsCount = Posts.Where(s => s.Cats.Contains(value)).Count();

            Posts = Posts.Where(s => !s.Cats.Contains(value)).ToList();

            OnPostsUpdate?.Invoke();

            return(willRemovedPostsCount > 0);
        }
示例#3
0
        internal bool RemovePost(IEnumerable <int> ids)
        {
            int willRemovedPostsCount = Posts.Where(s => ids.Contains(s.Id)).Count();

            Posts = Posts.Where(s => !ids.Contains(s.Id)).ToList();

            OnPostsUpdate?.Invoke();

            return(willRemovedPostsCount > 0);
        }