Пример #1
0
        private void SelectTag(object param)
        {
            var tag = param as Tag;

            if (tag == null)
            {
                return;
            }

            if (tag.HasValue &&
                !ValueEnterMode)
            {
                SearchString   = tag.Title;
                ValueEnterMode = true;
                EditedTag      = tag;
                return;
            }

            if (SelectedBindedTags.All(x => x.Tag.Id != tag.Id || x.Value != EnteredValue))
            {
                SelectedBindedTags.Add(new BindedTagVM(new BindedTag
                {
                    Tag   = tag,
                    Value = (tag.HasValue && !string.IsNullOrWhiteSpace(EnteredValue))
                            ? SelectedComparator + EnteredValue
                            : null,
                    SearchType = SearchType.Include
                }));
            }

            SearchString = string.Empty;
            OnSelectedTagsUpdated();
        }
Пример #2
0
        private void SelectBindedTag(object param)
        {
            var tag = param as BindedTagVM;

            if (tag == null)
            {
                return;
            }

            if (SelectedBindedTags.All(x => x.Tag.Id != tag.Tag.Id || x.Value != tag.Value))
            {
                SelectedBindedTags.Add(new BindedTagVM(new BindedTag
                {
                    Tag        = tag.Tag,
                    Value      = tag.Value,
                    SearchType = SearchType.Include
                }));
            }

            OnSelectedTagsUpdated();
        }