Exemple #1
0
        private void TextChanged(string searchText)
        {
            var list = new List <string>();

            if (string.IsNullOrEmpty(searchText))
            {
                list = AllRecordsByName;
            }
            else
            {
                list = AllRecordsByName.FindAll(s => s.Contains(searchText));
                if (list.Count == 0)
                {
                    OnPropertyChanged(nameof(IsNotExistSearchResult));
                }
            }

            foreach (var tagItem in TagItems)
            {
                list.Remove(tagItem.Name);
            }

            list.Sort();

            SortRecordsBySearch(list);
        }
        private void RefreshRecordsBySearch()
        {
            List <string> list = AllRecordsByName.ToList();

            foreach (var tagItem in TagItems)
            {
                list.Remove(tagItem.Name);
            }

            SortRecordsBySearch(list);
        }
Exemple #3
0
        private void InitRecordsForSearch()
        {
            AllRecordsByName.Clear();

            foreach (var record in Records)
            {
                var IsAlreadyExist = AllRecordsByName.Exists(r => r == record.Name);
                if (!IsAlreadyExist)
                {
                    if (TagItems.ToList().Exists(t => t.Name != record.Name))
                    {
                        RecordsBySearch.Add(record.Name);
                    }
                    AllRecordsByName.Add(record.Name);
                }
            }
        }