private static IAFElementTemplateContoller GetController(Connection Connection) { IAFElementTemplateContoller result = null; if (Connection is WebAPI.WebAPIConnection) { result = new WebAPI.AFElementTemplateController(); } return(result); }
private void Initialize() { _templateController = GetController(_Connection); // Load Categories _Categories = new Lazy <ObservableCollection <string> >(() => { ObservableCollection <string> collection = new ObservableCollection <string>(_templateController.GetCategories(_Connection, ID)); collection.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(CategoriesChanged); return(collection); }, System.Threading.LazyThreadSafetyMode.ExecutionAndPublication); }