예제 #1
0
 private bool TagFilter(ImageDocument document)
 {
     if (Tags.All(x => x.IsEnable.Value is false))
     {
         return(true);
     }
     return(Tags.Where(x => x.IsEnable.Value)
            .Any(x =>
                 document.GetTags()
                 .Contains(x.Name)));
 }
예제 #2
0
        public TagEditorVm(ImageDocument imageDocument, ConfigService configService)
        {
            var documentTags = imageDocument.GetTags();

            Tags = configService.Tags.ToReadOnlyReactiveCollection(x => new TagItemVm(x, documentTags.Contains(x)))
                   .AddTo(Disposables);

            ApplyCommand = new DelegateCommand(() =>
            {
                imageDocument.SetTags(
                    Tags.Where(x => x.IsEnable.Value)
                    .Select(x => x.Name)
                    .ToArray());
            });
        }