public void SetModel(string modelName) { var repository = workspaceMan.GetRepository(modelName); if (repository == null) { throw new InvalidOperationException($"Repository with name '{modelName}' not found."); } _edited = repository; //var vm = application.GetInterface<DbTableFactory>().CreateTable(_edited); UpdateVM(_edited); tableName = modelName; TablePresentationName = modelName; UpdateTitle(); if (_newEntryCreator != null) { _newEntryCreator.Close(); _newEntryCreator = null; } }
public EntryRefIdSelectorVM(IWorkspaceMan workspaceMan, Type type) { Items = new BindingList <string>(); var repository = workspaceMan.GetRepository(type); Items.UpdateAfter(() => { repository.Entries.ForEach(item => Items.Add(item.Id)); }); }
protected EntryEditorBaseVM(IWorkspaceMan workspaceMan, IDialogProvider dialogProvider) { WorkspaceMan = workspaceMan; this.dialogProvider = dialogProvider; repository = WorkspaceMan.GetRepository <E>(); }