private void OnStartupIdleProcessing()
 {
     PerformanceUtility.StartPerformanceSequence(PerformanceEvent.PostingFirstIdleandCallingApplicationRun);
     UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(this.OnFirstIdle));
     PropertyCacheHelper.PopulateStartupReflectionCache();
     UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(FontEmbedder.CreateSystemFontFamiliesCache));
     UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(this.OnLastIdle));
 }
        private async Task SetCacheEntries()
        {
            var propertyTypes = await PropertyCacheHelper.GetOrSetCacheEntry(_propertyViewModelService, _cache, CacheKey.Property);

            ViewBag.PropertyTypes = propertyTypes;

            var locations = await PropertyCacheHelper.GetOrSetCacheEntry(_propertyViewModelService, _cache, CacheKey.Location);

            ViewBag.Cities    = locations.Cast <EstateLocation>().Select(x => x.City).Distinct();
            ViewBag.Countries = locations.Cast <EstateLocation>().Select(x => x.Country).Distinct();
        }