private void LoadItems(bool refresh) { const string cacheKey = "Configurations"; var items = ControlCache.Get <IEnumerable>(cacheKey); if (refresh || items == null) { var itemsFunc = GetConfigurationsFunc(); if (itemsFunc != null) { try { items = itemsFunc(); ControlCache.Set(cacheKey, items); } catch { } } } Control.ItemsSource = items; }
private void LoadItems(bool refresh) { IEnumerable items = null; var configId = GetConfigId(); var version = GetVersion(); if (!string.IsNullOrWhiteSpace(configId)) { var cacheKey = "Documents_" + configId + version; items = ControlCache.Get <IEnumerable>(cacheKey); if (refresh || items == null) { var itemsFunc = GetDocumentsFunc(); if (itemsFunc != null) { try { items = itemsFunc(configId, version); ControlCache.Set(cacheKey, items); } catch { } } } } else { Control.EditValue = null; } Control.ItemsSource = items; }