Exemplo n.º 1
0
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            _searchService.Updating += OnSearchServiceUpdating;
            _searchService.Updated  += OnSearchServiceUpdated;

            _searchService.Searching += OnSearchServiceSearching;
            _searchService.Searched  += OnSearchServiceSearched;

            using (AllObjects.SuspendChangeNotifications())
            {
                var generatedSearchables = (await TaskHelper.Run(() => _dataGenerationService.GenerateSearchables(), true)).ToList();

                AllObjects.ReplaceRange(generatedSearchables.Select(x => x.Instance));
                AllObjectCount = AllObjects.Count;

                await TaskHelper.Run(() => _searchService.AddObjects(generatedSearchables), true);
            }
        }